[Twisted-Python] Threading traceback
Hi everyone,
I'm using twisted in a thread together with wxPython.
Everything works quite fine, but I'm getting a strange traceback when I exit
the application.
here's the scenario:
wx runs in the main thread
twisted runs in a secondary thread which is started like:
_daemon = DaemonLoop(self,self._port)
_daemon.setDaemon(True)
_daemon.start()
where Daemonloop is (partial):
class DaemonLoop(threading.Thread,pb.Referenceable):
def __init__(self, wxEvtHandler, port):
super(DaemonLoop, self).__init__()
self.ui = UIProxy(wxEvtHandler)
self.port=port
def _error(self,error):
if self.ui:
self.ui._error(error)
def run(self):
# Run reactor
reactor.run(installSignalHandlers=0)
def stop(self):
reactor.stop()
def connectionLost(self):
self.ui.connectionLost()
reactor.stop()
I stop the application from the main thread using
_daemon.stop() <- should kill the twisted reactor
wx.Exit() <- kills the main thread
The app exits (on linux), but I get this traceback:
Unhandled exception in thread started by
participants (1)
-
Uwe C. Schroeder