Mercurial > pidgin
changeset 21055:a0b0f988667e
Fix some leaks caused by GdkPixbufLoaders not being disposed of.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 30 Oct 2007 03:24:07 +0000 |
parents | 901b3e13c633 |
children | 9e45c28b4b2b |
files | pidgin/gtkaccount.c pidgin/gtkrequest.c pidgin/gtkstatusbox.c |
diffstat | 3 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkaccount.c Tue Oct 30 03:20:13 2007 +0000 +++ b/pidgin/gtkaccount.c Tue Oct 30 03:24:07 2007 +0000 @@ -212,6 +212,9 @@ 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 @@ 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,
--- a/pidgin/gtkrequest.c Tue Oct 30 03:20:13 2007 +0000 +++ b/pidgin/gtkrequest.c Tue Oct 30 03:24:07 2007 +0000 @@ -931,7 +931,7 @@ 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;
--- a/pidgin/gtkstatusbox.c Tue Oct 30 03:20:13 2007 +0000 +++ b/pidgin/gtkstatusbox.c Tue Oct 30 03:24:07 2007 +0000 @@ -2162,6 +2162,9 @@ 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)