# HG changeset patch # User Luke Schierer # Date 1078164071 0 # Node ID c1ca19c8f749e5d7363517ad76e6dd530e157e72 # Parent 7e9fdaab71631431986039bd44776b4006af07ec [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 diff -r 7e9fdaab7163 -r c1ca19c8f749 src/gtkroomlist.c --- 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,