im.pidgin.pidgin: 41094da072afab652217343e975123768e7f797b

datallah at pidgin.im datallah at pidgin.im
Mon Oct 29 23:30:38 EDT 2007


-----------------------------------------------------------------
Revision: 41094da072afab652217343e975123768e7f797b
Ancestor: 8d977e2a9c350868a378a8e420dbfdf1ed0f0642
Author: datallah at pidgin.im
Date: 2007-10-30T03:24:07
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkaccount.c pidgin/gtkrequest.c
        pidgin/gtkstatusbox.c

ChangeLog: 

Fix some leaks caused by GdkPixbufLoaders not being disposed of.

-------------- next part --------------
============================================================
--- pidgin/gtkaccount.c	bc34da4d9d0a42b40b6cdae6e7c3ec118f06a777
+++ pidgin/gtkaccount.c	f51aaf31c4f0bd09b6a31b46e621e7fde4f454d7
@@ -212,6 +212,9 @@ set_dialog_icon(AccountPrefsDialog *dial
 		                        purple_imgstore_get_size(dialog->icon_img), NULL);
 		gdk_pixbuf_loader_close(loader, NULL);
 		pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
+		if (pixbuf)
+			g_object_ref(pixbuf);
+		g_object_unref(loader);
 	}
 
 	if (pixbuf && dialog->prpl_info &&
@@ -2056,8 +2059,9 @@ set_account(GtkListStore *store, GtkTree
 
 		if (buddyicon_pixbuf != NULL) {
 			buddyicon = gdk_pixbuf_scale_simple(buddyicon_pixbuf, 22, 22, GDK_INTERP_HYPER);
-			g_object_unref(G_OBJECT(buddyicon_pixbuf));
 		}
+
+		g_object_unref(loader);
 	}
 
 	gtk_list_store_set(store, iter,
============================================================
--- pidgin/gtkrequest.c	7af6502bb0bcdc77a8f7e8516f13754e3892ea03
+++ pidgin/gtkrequest.c	001f5a384f267e684ea134ecbe36d6ee346a5c6f
@@ -931,7 +931,7 @@ create_image_field(PurpleRequestField *f
 			purple_request_field_image_get_scale_y(field) * gdk_pixbuf_get_height(buf),
 			GDK_INTERP_BILINEAR);
 	widget = gtk_image_new_from_pixbuf(scale);
-	g_object_unref(G_OBJECT(buf));
+	g_object_unref(G_OBJECT(loader));
 	g_object_unref(G_OBJECT(scale));
 
 	return widget;
============================================================
--- pidgin/gtkstatusbox.c	063b9de96460ac58e129b577249c979e0327eb60
+++ pidgin/gtkstatusbox.c	aba6feec768a3d78df9c9f2f83f6f141ce9a9175
@@ -2162,6 +2162,9 @@ pidgin_status_box_redisplay_buddy_icon(P
 		                        purple_imgstore_get_size(status_box->buddy_icon_img), NULL);
 		gdk_pixbuf_loader_close(loader, NULL);
 		status_box->buddy_icon = gdk_pixbuf_loader_get_pixbuf(loader);
+		if (status_box->buddy_icon)
+			g_object_ref(status_box->buddy_icon);
+		g_object_unref(loader);
 	}
 
 	if (status_box->buddy_icon == NULL)


More information about the Commits mailing list