diff -r 141a7145c099 -r 0bc32427a459 Beremiz_service.py --- a/Beremiz_service.py Fri Oct 24 14:01:36 2008 +0200 +++ b/Beremiz_service.py Fri Oct 24 14:36:52 2008 +0200 @@ -177,7 +177,7 @@ self.workdir = workdir self.args = args self.plcobj = None - self.servicepublisher = ServicePublisher.ServicePublisher() + self.servicepublisher = None def Loop(self): while self.continueloop: @@ -203,7 +203,8 @@ # Configure and publish service # Not publish service if localhost in address params if self.ip != "localhost" and self.ip != "127.0.0.1": - print "Publish service on local network" + print "Publish service on local network" + self.servicepublisher = ServicePublisher.ServicePublisher() self.servicepublisher.RegisterService(self.name, self.ip, self.port) sys.stdout.flush() @@ -211,7 +212,9 @@ self.daemon.requestLoop() def Stop(self): - self.servicepublisher.UnRegisterService() + if self.servicepublisher is not None: + self.servicepublisher.UnRegisterService() + del self.servicepublisher self.daemon.shutdown(True) class ParamsEntryDialog(wx.TextEntryDialog): @@ -335,6 +338,7 @@ def OnTaskBarQuit(self,evt): pyroserver.Quit() self.RemoveIcon() + wx.GetApp().ExitMainLoop() pyroserver = Server(name, ip, port, WorkingDir, args)