Fixed repetitive freezing of IDE when connection drops.
authorEdouard Tisserant
Fri, 12 Jul 2019 11:51:47 +0200
changeset 2622 e10a1095f577
parent 2621 af09744a468e
child 2623 26ba948a2e51
Fixed repetitive freezing of IDE when connection drops.
when connection lost error was beeing displayed, the involved wxYield
was calling pending plc status periodic update, itself trying to use connector.
At that time connector is still not destroyed and connection
is attempted again when calling GetPLCStatus.
=> Hack : Ensure connector is destroyed before reporting error.
connectors/PYRO/__init__.py
--- a/connectors/PYRO/__init__.py	Wed Jul 10 11:21:13 2019 +0200
+++ b/connectors/PYRO/__init__.py	Fri Jul 12 11:51:47 2019 +0200
@@ -97,8 +97,8 @@
             try:
                 return func(*args, **kwargs)
             except Pyro.errors.ConnectionClosedError as e:
+                confnodesroot._SetConnector(None)
                 confnodesroot.logger.write_error(_("Connection lost!\n"))
-                confnodesroot._SetConnector(None)
             except Pyro.errors.ProtocolError as e:
                 confnodesroot.logger.write_error(_("Pyro exception: %s\n") % e)
             except Exception as e: