# HG changeset patch # User Paul Aurich # Date 1255992987 0 # Node ID 0486e2a9b48f034cb4c2e4e9fe6aa84fdaab5295 # Parent 41992511531f7336312d121b4e2c339913e378f8 When switching the account in the Disco / Room List dialogs, kill the visible results, as the results are not at all guaranteed to be applicable to the newly-selected account. Among other things, this happens when you disconnect an account with the Disco Browser or Room List dialogs open. diff -r 41992511531f -r 0486e2a9b48f pidgin/gtkroomlist.c --- a/pidgin/gtkroomlist.c Sat Oct 17 00:37:04 2009 +0000 +++ b/pidgin/gtkroomlist.c Mon Oct 19 22:56:27 2009 +0000 @@ -111,7 +111,18 @@ static void dialog_select_account_cb(GObject *w, PurpleAccount *account, PidginRoomlistDialog *dialog) { + gboolean change = (account != dialog->account); dialog->account = account; + + if (change && dialog->roomlist) { + PidginRoomlist *rl = dialog->roomlist->ui_data; + if (rl->tree) { + gtk_widget_destroy(rl->tree); + rl->tree = NULL; + } + purple_roomlist_unref(dialog->roomlist); + dialog->roomlist = NULL; + } } static void list_button_cb(GtkButton *button, PidginRoomlistDialog *dialog) diff -r 41992511531f -r 0486e2a9b48f pidgin/plugins/disco/gtkdisco.c --- a/pidgin/plugins/disco/gtkdisco.c Sat Oct 17 00:37:04 2009 +0000 +++ b/pidgin/plugins/disco/gtkdisco.c Mon Oct 19 22:56:27 2009 +0000 @@ -141,8 +141,18 @@ static void dialog_select_account_cb(GObject *w, PurpleAccount *account, PidginDiscoDialog *dialog) { + gboolean change = (account != dialog->account); dialog->account = account; gtk_widget_set_sensitive(dialog->browse_button, account != NULL); + + if (change && dialog->discolist) { + if (dialog->discolist->tree) { + gtk_widget_destroy(dialog->discolist->tree); + dialog->discolist->tree = NULL; + } + pidgin_disco_list_unref(dialog->discolist); + dialog->discolist = NULL; + } } static void register_button_cb(GtkWidget *unused, PidginDiscoDialog *dialog)