From: Ed Page Date: Sat, 13 Mar 2010 16:39:27 +0000 (-0600) Subject: Moved when we advertise the connection as disconnected to start the shutdown-on-idle... X-Git-Url: http://vcs.maemo.org/git/?p=theonering;a=commitdiff_plain;h=3b43bd098274b1944cf6dc252ec1d53b0a0ba4cb Moved when we advertise the connection as disconnected to start the shutdown-on-idle countdown as late as possible --- diff --git a/src/connection.py b/src/connection.py index 933c372..31ecd53 100644 --- a/src/connection.py +++ b/src/connection.py @@ -302,4 +302,9 @@ class TheOneRingConnection( self.session.logout() self.session.close() + # In case one of the above items takes too long (which it should never + # do), we leave the starting of the shutdown-on-idle counter to the + # very end + self.manager.disconnect_completed(self) + _moduleLogger.info("Disconnected") diff --git a/src/connection_manager.py b/src/connection_manager.py index be1702a..b9a8e37 100644 --- a/src/connection_manager.py +++ b/src/connection_manager.py @@ -61,11 +61,7 @@ class TheOneRingConnectionManager(tp.ConnectionManager): return result - def disconnected(self, conn): - """ - Overrides tp.ConnectionManager - """ - result = tp.ConnectionManager.disconnected(self, conn) + def disconnect_completed(self): gobject_utils.timeout_add_seconds(self.IDLE_TIMEOUT, self._shutdown) def quit(self):