changeset 5427:04e1e40b99b0

[gaim-migrate @ 5806] Fixed a tiny memleak in msn.c. Chip: the other leak memprof is complaining about is from line 134 of src/protocols/msn/servconn.c I tried freeing the hash table in msn_servocnn_destroy, but that resulted in a crash after signing on then off then on again. I don't know what's up with that, maybe it's not really a memleak. Also, I guess item factories aren't freed automatically? It seems like they should be, but gtkconv.c calls g_object_unref on the item factory explicitly, and not calling it on the item factory for the blist shows up as a memleak. So that should be fixed now. Oh, I also removed a function declaration for a static function... committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 18 May 2003 07:54:54 +0000
parents 8d8bf0d31a23
children 96bde36bb76b
files src/gtkblist.c src/gtkblist.h src/protocols/msn/session.c src/ui.h
diffstat 4 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkblist.c	Sun May 18 05:45:18 2003 +0000
+++ b/src/gtkblist.c	Sun May 18 07:54:54 2003 +0000
@@ -1329,7 +1329,6 @@
 
 static void gaim_gtk_blist_show(struct gaim_buddy_list *list)
 {
-	GtkItemFactory *ift;
 	GtkCellRenderer *rend;
 	GtkTreeViewColumn *column;
 	GtkWidget *sw;
@@ -1365,21 +1364,21 @@
 	accel_group = gtk_accel_group_new();
 	gtk_window_add_accel_group(GTK_WINDOW (gtkblist->window), accel_group);
 	g_object_unref(accel_group);
-	ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<GaimMain>", accel_group);
-	gtk_item_factory_set_translate_func (ift,
+	gtkblist->ift = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<GaimMain>", accel_group);
+	gtk_item_factory_set_translate_func (gtkblist->ift,
 					     item_factory_translate_func,
 					     NULL, NULL);
-	gtk_item_factory_create_items(ift, sizeof(blist_menu) / sizeof(*blist_menu),
+	gtk_item_factory_create_items(gtkblist->ift, sizeof(blist_menu) / sizeof(*blist_menu),
 				      blist_menu, NULL);
-	gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtk_item_factory_get_widget(ift, "<GaimMain>"), FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(gtkblist->vbox), gtk_item_factory_get_widget(gtkblist->ift, "<GaimMain>"), FALSE, FALSE, 0);
 
-	awaymenu = gtk_item_factory_get_widget(ift, N_("/Tools/Away"));
+	awaymenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Away"));
 	do_away_menu();
 
-	gtkblist->bpmenu = gtk_item_factory_get_widget(ift, N_("/Tools/Buddy Pounce"));
+	gtkblist->bpmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Buddy Pounce"));
 	gaim_gtkpounce_menu_build(gtkblist->bpmenu);
 
-	protomenu = gtk_item_factory_get_widget(ift, N_("/Tools/Protocol Actions"));
+	protomenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Tools/Protocol Actions"));
 	do_proto_menu();
 
 	/****************************** GtkTreeView **********************************/
@@ -1462,9 +1461,9 @@
 	/* set the Show Offline Buddies option. must be done
 	 * after the treeview or faceprint gets mad. -Robot101
 	 */
-	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (ift, N_("/Buddies/Show Offline Buddies"))),
+	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Offline Buddies"))),
 			blist_options & OPT_BLIST_SHOW_OFFLINE);
-	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (ift, N_("/Buddies/Show Empty Groups"))),
+	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_item (gtkblist->ift, N_("/Buddies/Show Empty Groups"))),
 			!(blist_options & OPT_BLIST_NO_MT_GRP));
 
 	/* OK... let's show this bad boy. */
@@ -1718,8 +1717,6 @@
 		if (GAIM_BLIST_NODE_IS_BUDDY(node)) {
 			if (((struct buddy*)node)->present != GAIM_BUDDY_OFFLINE || ((blist_options & OPT_BLIST_SHOW_OFFLINE) && ((struct buddy*)node)->account->gc)) {
 				GtkTreeIter groupiter;
-				GaimBlistNode *oldersibling;
-				GtkTreeIter oldersiblingiter;
 				char *collapsed = gaim_group_get_setting((struct group *)node->parent, "collapsed");
 
 				if(node->parent &&
@@ -1947,6 +1944,7 @@
 	gtkblist->idle_column = NULL;
 	gtkblist->warning_column = gtkblist->buddy_icon_column = NULL;
 	gtkblist->bbox = gtkblist->tipwindow = NULL;
+	g_object_unref(G_OBJECT(gtkblist->ift));
 	protomenu = NULL;
 	awaymenu = NULL;
 	gtkblist = NULL;
--- a/src/gtkblist.h	Sun May 18 05:45:18 2003 +0000
+++ b/src/gtkblist.h	Sun May 18 07:54:54 2003 +0000
@@ -56,6 +56,7 @@
 		*warning_column, 
 		*buddy_icon_column;
 
+	GtkItemFactory *ift;
 	GtkWidget *bpmenu;              /**< The buddy pounce menu. */
 
 	GtkWidget *bbox;                /**< A Button Box. */
--- a/src/protocols/msn/session.c	Sun May 18 05:45:18 2003 +0000
+++ b/src/protocols/msn/session.c	Sun May 18 07:54:54 2003 +0000
@@ -66,6 +66,11 @@
 
 	msn_users_destroy(session->users);
 
+	g_free(session->passport_info.kv);
+	g_free(session->passport_info.sid);
+	g_free(session->passport_info.mspauth);
+	g_free(session->passport_info.file);
+
 	g_free(session);
 }
 
--- a/src/ui.h	Sun May 18 05:45:18 2003 +0000
+++ b/src/ui.h	Sun May 18 07:54:54 2003 +0000
@@ -232,7 +232,6 @@
 extern void ui_remove_group(struct group *);
 extern void toggle_buddy_pixmaps();
 extern void gaim_separator(GtkWidget *);
-extern void redo_buddy_list(); /* you really shouldn't call this function */
 extern void set_blist_tab();
 extern void hide_buddy_list();
 extern void unhide_buddy_list();