Fix signalreceiver crashing on daemon switch.

Fix exception on shutdown in signalreceiver.
This commit is contained in:
Andrew Resch 2008-03-09 03:27:25 +00:00
parent 969b43d069
commit 5d91c170e4
2 changed files with 1 additions and 7 deletions

View File

@ -45,7 +45,7 @@ class Signals(component.Component):
if not client.is_localhost():
self.receiver.set_remote(True)
self.receiver.start()
self.receiver.run()
self.receiver.connect_to_signal("torrent_added",
self.torrent_added_signal)
self.receiver.connect_to_signal("torrent_removed",

View File

@ -46,21 +46,16 @@ import threading
from deluge.log import LOG as log
class SignalReceiver(
threading.Thread,
ThreadingMixIn,
SimpleXMLRPCServer.SimpleXMLRPCServer):
def __init__(self):
log.debug("SignalReceiver init..")
gobject.threads_init()
threading.Thread.__init__(self)
# Set to true so that the receiver thread will exit
self._shutdown = False
# Daemonize the thread so it exits when the main program does
self.setDaemon(True)
self.signals = {}
self.remote = False
@ -125,7 +120,6 @@ class SignalReceiver(
while not self._shutdown:
self.handle_request()
self._shutdown = False
self.server_close()
def emit_signal(self, signal, *data):
"""Exported method used by the core to emit a signal to the client"""