Runtime Quit should not crash when plc noyt stopped
authorEdouard Tisserant
Fri, 21 Sep 2012 22:31:58 +0200
changeset 837 fb0b66e9b4dd
parent 836 b59e563bcada
child 838 06db7d4edbe6
Runtime Quit should not crash when plc noyt stopped
Beremiz_service.py
--- a/Beremiz_service.py	Fri Sep 21 16:22:56 2012 +0200
+++ b/Beremiz_service.py	Fri Sep 21 22:31:58 2012 +0200
@@ -23,7 +23,7 @@
 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 import os, sys, getopt
-from threading import Thread
+from threading import Thread,Timer
 
 def usage():
     print """
@@ -416,7 +416,7 @@
             def OnTaskBarQuit(self, evt):
                 Thread(target=self.pyroserver.Quit).start()
                 self.RemoveIcon()
-                wx.CallAfter(wx.GetApp().Exit)
+                Timer(1, wx.CallAfter(wx.GetApp().Exit)).start()
                 evt.Skip()
             
             def UpdateIcon(self, plcstatus):