From f853ac209b13a6fe7516aabc16b5b943946d2d92 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 2 Aug 2008 03:25:34 +0000 Subject: [PATCH] Handle shutting down more cleanly in the gtkui --- ChangeLog | 3 +++ deluge/ui/gtkui/gtkui.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 582012f92..553586655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ Deluge 0.9.05 - "1.0.0_RC5" (In Development) Core: * Fix deluged running with ssh X forwarding by removing the Gnome lib import * Save resume data periodically to help prevent data loss + + GtkUI: + * Handle shutting down more cleanly Plugins: * Improve the Blocklist plugin preferences page. diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index cf78d9fd8..822071827 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -216,7 +216,7 @@ class GtkUI: else: self.shutdown() - def shutdown(self, data=None): + def shutdown(self, *args, **kwargs): log.debug("gtkui shutting down..") # Make sure the config is saved. @@ -229,7 +229,10 @@ class GtkUI: client.shutdown() except: pass - + try: + gtk.main_quit() + except RuntimeError: + pass def _on_new_core(self, data): component.start()