changeset 21639:fa5d1f426332

I'm pretty sure this is what was intended.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 26 Nov 2007 05:30:36 +0000
parents dc9d0141a35f
children ed57eeb486d5
files pidgin/gtkscrollbook.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkscrollbook.c	Mon Nov 26 01:25:29 2007 +0000
+++ b/pidgin/gtkscrollbook.c	Mon Nov 26 05:30:36 2007 +0000
@@ -146,15 +146,13 @@
 static void
 pidgin_scroll_book_add(GtkContainer *container, GtkWidget *widget)
 {
-	GList *children;
 	PidginScrollBook *scroll_book;
 
 	g_return_if_fail(GTK_IS_WIDGET (widget));
 	g_return_if_fail (widget->parent == NULL);
 
 	scroll_book = PIDGIN_SCROLL_BOOK(container);
-	children = scroll_book->children;
-	children = g_list_append(children, widget);
+	scroll_book->children = g_list_append(scroll_book->children, widget);
 	gtk_widget_show(widget);
 	gtk_notebook_append_page(GTK_NOTEBOOK(PIDGIN_SCROLL_BOOK(container)->notebook), widget, NULL);
 	page_count_change_cb(PIDGIN_SCROLL_BOOK(container));
@@ -176,10 +174,10 @@
 		child = children->data;
 		if (child == widget) {
 			gtk_widget_unparent (widget);
-			children = g_list_remove_link (scroll_book->children, children);
-			g_list_free(children);
+			scroll_book->children = g_list_delete_link(scroll_book->children, children);
 			break;
 		}
+		children = children->next;
 	}
 
 	page = gtk_notebook_page_num(GTK_NOTEBOOK(PIDGIN_SCROLL_BOOK(container)->notebook), widget);