From 6f3bc5620f6624eff5717539207c14c124a9fc2d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 1 May 2011 07:41:44 +0100 Subject: [PATCH] Fix #1824. When connected to a client, and then trying to connect to another, the connection manager component will be stopped(while the connect deferred is still running), so, the ConnectionManager.connection_manager reference will be deleted. If that's not the case, close the dialog. --- deluge/ui/gtkui/connectionmanager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py index c61fe4a6c..55da39b16 100644 --- a/deluge/ui/gtkui/connectionmanager.py +++ b/deluge/ui/gtkui/connectionmanager.py @@ -498,7 +498,12 @@ class ConnectionManager(component.Component): def __on_connected(self, daemon_info, host_id): if self.gtkui_config["autoconnect"]: self.gtkui_config["autoconnect_host_id"] = host_id - self.connection_manager.response(gtk.RESPONSE_OK) + if self.running: + # When connected to a client, and then trying to connect to another, + # this component will be stopped(while the connect deferred is + # runing), so, self.connection_manager will be deleted. + # If that's not the case, close the dialog. + self.connection_manager.response(gtk.RESPONSE_OK) component.start() def __on_connected_failed(self, reason, host_id, host, port, user):