changeset 11611:311a743df5ca

[gaim-migrate @ 13884] fix a crash on getting an im after you close a window with the person by closing the whole window rather than the conversation. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 05 Oct 2005 00:28:06 +0000
parents 69bd7af50d31
children 6135c29a514f
files src/gtkconv.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Tue Oct 04 13:52:09 2005 +0000
+++ b/src/gtkconv.c	Wed Oct 05 00:28:06 2005 +0000
@@ -6191,6 +6191,20 @@
 {
 	window_list = g_list_remove(window_list, win);
 
+	if (win->gtkconvs) {
+		while (win->gtkconvs) {
+			GList *nextgtk = win->gtkconvs->next;
+			GaimGtkConversation *gtkconv = win->gtkconvs->data;
+			GList *nextcore = gtkconv->convs->next;
+			GaimConversation *conv = gtkconv->convs->data;
+			gaim_conversation_destroy(conv);
+			if (!nextgtk && !nextcore)
+			/* we'll end up invoking ourselves when we destroy our last child */
+			/* so don't destroy ourselves right now */
+				return;
+		}
+		return;
+	}
 	gtk_widget_destroy(win->window);
 
 	g_object_unref(G_OBJECT(win->menu.item_factory));