Fixing a resource leak where on connection failure, the connection would be left...
authorEd Page <eopage@byu.net>
Tue, 9 Feb 2010 13:18:19 +0000 (07:18 -0600)
committerEd Page <eopage@byu.net>
Tue, 9 Feb 2010 13:18:19 +0000 (07:18 -0600)
src/connection.py

index 22d6885..73ec4a4 100644 (file)
@@ -207,17 +207,11 @@ class TheOneRingConnection(
                        self.__channelManager.channel_for_props(publishProps, signal=True)
                except gvoice.backend.NetworkError, e:
                        _moduleLogger.exception("Connection Failed")
-                       self.StatusChanged(
-                               telepathy.CONNECTION_STATUS_DISCONNECTED,
-                               telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR
-                       )
+                       self.disconnect(telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR)
                        return
                except Exception, e:
                        _moduleLogger.exception("Connection Failed")
-                       self.StatusChanged(
-                               telepathy.CONNECTION_STATUS_DISCONNECTED,
-                               telepathy.CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED
-                       )
+                       self.disconnect(telepathy.CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED)
                        return
 
                _moduleLogger.info("Connected")