Ensure Beremiz_service.py quits properly when Main Worker stops and wa are using Wx and/or Twisted.
authorEdouard Tisserant
Tue, 16 Apr 2019 11:26:34 +0200
changeset 2595 a0d2741a6722
parent 2594 f1e182818434
child 2596 779e8dbf1ee1
Ensure Beremiz_service.py quits properly when Main Worker stops and wa are using Wx and/or Twisted.
Beremiz_service.py
--- a/Beremiz_service.py	Mon Apr 15 13:34:09 2019 +0200
+++ b/Beremiz_service.py	Tue Apr 16 11:26:34 2019 +0200
@@ -586,4 +586,9 @@
 plcobj.StopPLC()
 plcobj.UnLoadPLC()
 
+if havetwisted:
+    reactor.stop()
+elif havewx:
+    app.ExitMainLoop()
+
 sys.exit(0)