diff --git a/ChangeLog b/ChangeLog index 0f876ca08..c5448755c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ Deluge 0.9.07 - "1.0.0_RC7" (In Development) Windows: * Fix Vista slowness issue + * Fix properly shutting Deluge down when system shuts down Deluge 0.9.06 - "1.0.0_RC6" (13 August 2008) Core: diff --git a/deluge/core/core.py b/deluge/core/core.py index 92e0eb788..58bcadc2f 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -176,9 +176,11 @@ class Core( else: from win32api import SetConsoleCtrlHandler from win32con import CTRL_CLOSE_EVENT + from win32con import CTRL_SHUTDOWN_EVENT result = 0 def win_handler(ctrl_type): - if ctrl_type == CTRL_CLOSE_EVENT: + log.debug("ctrl_type: %s", ctrl_type) + if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT: self._shutdown() result = 1 return result diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 2e8d6fa15..1d4497b1f 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -140,9 +140,11 @@ class GtkUI: if deluge.common.windows_check(): from win32api import SetConsoleCtrlHandler from win32con import CTRL_CLOSE_EVENT + from win32con import CTRL_SHUTDOWN_EVENT result = 0 def win_handler(ctrl_type): - if ctrl_type == CTRL_CLOSE_EVENT: + log.debug("ctrl_type: %s", ctrl_type) + if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT: self.shutdown() return 1 SetConsoleCtrlHandler(win_handler)