diff -r 7e266d890064 -r f7b7a6c58ad3 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Sun Jul 29 01:11:54 2012 -0400 +++ b/pidgin/gtkconv.c Sun Jul 29 01:21:26 2012 -0400 @@ -9380,6 +9380,17 @@ void pidgin_conv_window_destroy(PidginWindow *win) { + PidginConversation *gtkconv; + GList *iter; + + if (win->gtkconvs) { + for (iter = win->gtkconvs; iter != NULL; iter = iter->next) { + gtkconv = iter->data; + close_conv_cb(NULL, gtkconv); + } + return; + } + purple_prefs_disconnect_by_handle(win); window_list = g_list_remove(window_list, win); @@ -9387,15 +9398,6 @@ if (win->dialogs.search) gtk_widget_destroy(win->dialogs.search); - if (win->gtkconvs) { - while (win->gtkconvs) { - gboolean last = (win->gtkconvs->next == NULL); - close_conv_cb(NULL, win->gtkconvs->data); - if (last) - break; - } - return; - } gtk_widget_destroy(win->window); g_object_unref(G_OBJECT(win->menu.item_factory));