From c53a7c69b9b6615a73a392879458f6a4314ca1a8 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 13 Feb 2012 12:13:24 +0000 Subject: console UI: quit cleanly if connection has gone away The console UI doesn't watch for NameOwnerChanged to notice the connection going away from beneath it. No big deal, it's a tool for nerds, but if you tried to quit it, it would not close cleanly: the call to self.snoopy.teardown() (which tries to turn off the connection dumping all stanzas over D-Bus) throws an exception, and so Gtk.main_quit() never got called. --- plugins/telepathy-gabble-xmpp-console | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/telepathy-gabble-xmpp-console b/plugins/telepathy-gabble-xmpp-console index 8b96469d8..731929ba1 100755 --- a/plugins/telepathy-gabble-xmpp-console +++ b/plugins/telepathy-gabble-xmpp-console @@ -347,7 +347,11 @@ plugin installed.""" % locals() self.connect('destroy', Window.__destroy_cb) def __destroy_cb(self): - self.snoopy.teardown() + try: + self.snoopy.teardown() + except GLib.GError, e: + print "Couldn't turn off the monitor (maybe the connection went away?)" + print e Gtk.main_quit() GABBLE_PREFIX = 'org.freedesktop.Telepathy.Connection.gabble.jabber.' -- cgit v1.2.3