Fix deluge-gtk hanging on shutdown (thanks Jan Steffens)

This commit is contained in:
John Garland 2010-05-02 22:23:49 +10:00
parent cc086917c1
commit 72fd3bd061

View file

@ -167,7 +167,7 @@ class GtkUI(object):
self.gnome_prog = gnome.init("Deluge", deluge.common.get_version())
self.gnome_client = gnome.ui.master_client()
def on_die(*args):
gtk.main_quit()
reactor.stop()
self.gnome_client.connect("die", on_die)
log.debug("GNOME session 'die' handler registered!")
except Exception, e:
@ -180,7 +180,7 @@ class GtkUI(object):
def win_handler(ctrl_type):
log.debug("ctrl_type: %s", ctrl_type)
if ctrl_type in (CTRL_CLOSE_EVENT, CTRL_SHUTDOWN_EVENT):
gtk.main_quit()
reactor.stop()
return 1
SetConsoleCtrlHandler(win_handler)