From: Nathan W. <fac...@us...> - 2003-03-12 02:27:31
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv31048/src Modified Files: buddy.c list.c Log Message: plug a leak or two, and make removing buddies not blow up. Index: buddy.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/buddy.c,v retrieving revision 1.419 retrieving revision 1.420 diff -u -d -r1.419 -r1.420 --- buddy.c 11 Mar 2003 22:31:24 -0000 1.419 +++ buddy.c 12 Mar 2003 02:27:28 -0000 1.420 @@ -192,8 +192,10 @@ gtk_tree_model_get_value (GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &val); node = g_value_get_pointer(&val); - if (!GAIM_BLIST_NODE_IS_BUDDY(node)) + if (!GAIM_BLIST_NODE_IS_BUDDY(node)) { + gtk_tree_path_free(path); return FALSE; + } menu = gtk_menu_new(); @@ -237,6 +239,7 @@ * the event propoagates down and somehow gets interpreted as the start of a drag event. */ sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv)); gtk_tree_selection_select_path(sel, path); + gtk_tree_path_free(path); return TRUE; #endif } @@ -312,8 +315,10 @@ 8, /* bits */ (void*)&node, sizeof (node)); + + gtk_tree_path_free(sourcerow); } - + } static void gaim_gtk_blist_drag_data_rcv_cb(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, @@ -326,6 +331,7 @@ memcpy(&b, sd->data, sizeof(b)); if(gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, &path, &position)) { /* if we're here, I think it means the drop is ok */ + gtk_tree_path_free(path); } } } @@ -872,6 +878,7 @@ * we expand the group node */ GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &groupiter); gtk_tree_view_expand_row(GTK_TREE_VIEW(gtkblist->treeview), path, TRUE); + gtk_tree_path_free(path); } } } Index: list.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/list.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- list.c 12 Mar 2003 01:34:25 -0000 1.37 +++ list.c 12 Mar 2003 02:27:28 -0000 1.38 @@ -296,13 +296,21 @@ { struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; - GaimBlistNode *node = (GaimBlistNode*)buddy; - + GaimBlistNode *gnode, *node = (GaimBlistNode*)buddy; + struct group *group; + + gnode = node->parent; + group = (struct group *)gnode; + + if(gnode->child == node) + gnode->child = node->next; if (node->prev) node->prev->next = node->next; if (node->next) node->next->prev = node->prev; - + + group->members = g_slist_remove(group->members, buddy); + ops->remove(gaimbuddylist, node); g_free(buddy->name); g_free(buddy->alias); |