changeset 8377:c1ca19c8f749

[gaim-migrate @ 9104] " This is xgrimx's patch to fix a crash if you click the join button twice without changing the selection in the room list dialog. He had me take a look at it and I did and it fixes the problem." --marv committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 01 Mar 2004 18:01:11 +0000
parents 7e9fdaab7163
children 2b68c423357e
files src/gtkroomlist.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkroomlist.c	Mon Mar 01 05:15:15 2004 +0000
+++ b/src/gtkroomlist.c	Mon Mar 01 18:01:11 2004 +0000
@@ -156,6 +156,11 @@
 };
 
 static void
+join_button_data_change_cb(gpointer data) {
+	g_free(data);
+}
+
+static void
 selection_changed_cb(GtkTreeSelection *selection, GaimGtkRoomlist *grl) {
 	GtkTreeIter iter;
 	GValue val = { 0, };
@@ -177,7 +182,8 @@
 		info->list = dialog->roomlist;
 		info->room = room;
 
-		g_object_set_data(G_OBJECT(dialog->join_button), "room-info", info);
+		g_object_set_data_full(G_OBJECT(dialog->join_button), "room-info",
+							   info, join_button_data_change_cb);
 
 		gtk_widget_set_sensitive(dialog->join_button, TRUE);
 	} else {
@@ -198,8 +204,8 @@
 		
 	info = (struct _menu_cb_info*)g_object_get_data(G_OBJECT(button), "room-info");
 	
-	do_join_cb(grl->tree, info);
-	g_free(info);
+	if(info != NULL)
+		do_join_cb(grl->tree, info);
 }
 
 static void row_activated_cb(GtkTreeView *tv, GtkTreePath *path, GtkTreeViewColumn *arg2,