Beremiz_service.py
changeset 1121 d3838e8f1b90
parent 1067 4f460c1dffb5
child 1270 aa9bc3e6181d
--- a/Beremiz_service.py	Fri May 10 13:15:18 2013 +0200
+++ b/Beremiz_service.py	Fri May 10 15:17:33 2013 +0200
@@ -306,8 +306,10 @@
                 InspectionTool().Show(wnd, True)
             
             def OnTaskBarQuit(self, evt):
+                if wx.Platform == '__WXMSW__':
+                    Thread(target=self.pyroserver.Quit).start()
                 self.RemoveIcon()
-                wx.CallAfter(wx.GetApp().Exit)
+                wx.CallAfter(wx.GetApp().ExitMainLoop)
             
             def UpdateIcon(self, plcstatus):
                 if plcstatus is "Started" :
@@ -381,7 +383,6 @@
             self.servicepublisher.RegisterService(self.servicename, self.ip_addr, self.port)
         
         if self.autostart and self.plcobj.GetPLCstatus()[0] != "Empty":
-            self.plcobj.LoadPLC()
             self.plcobj.StartPLC()
         
         sys.stdout.flush()