diff options
author | Paolo Borelli <pborelli@katamail.com> | 2008-06-10 11:50:43 +0000 |
---|---|---|
committer | Paolo Borelli <pborelli@src.gnome.org> | 2008-06-10 11:50:43 +0000 |
commit | 9d73677b5a7e6440dfba338ae6c461aae3e77ad5 (patch) | |
tree | 275725839142e0c7e835e1b1c7f12c4d24399ebb | |
parent | b73f788cc22e11829a85db1ffc0e3eb3bc08406a (diff) | |
download | gdk-pixbuf-9d73677b5a7e6440dfba338ae6c461aae3e77ad5.tar.gz |
do not leak the GIcon.
2008-06-10 Paolo Borelli <pborelli@katamail.com>
* gtk/gtkfilesystem.c (gtk_file_system_volume_render_icon): do not
leak the GIcon.
svn path=/trunk/; revision=20346
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gtk/gtkfilesystem.c | 8 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2008-06-10 Paolo Borelli <pborelli@katamail.com> + + * gtk/gtkfilesystem.c (gtk_file_system_volume_render_icon): do not + leak the GIcon. + 2008-06-10 Carlos Garnacho <carlos@imendio.com> * configure.in: diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c index 095b71229..aa89a2c11 100644 --- a/gtk/gtkfilesystem.c +++ b/gtk/gtkfilesystem.c @@ -1697,6 +1697,7 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume *volume, GError **error) { GIcon *icon = NULL; + GdkPixbuf *pixbuf; DEBUG ("volume_get_icon_name"); @@ -1713,6 +1714,7 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume *volume, file = g_mount_get_root (mount); icon = get_icon_for_special_directory (file); + g_object_unref (file); if (!icon) icon = g_mount_get_icon (mount); @@ -1721,7 +1723,11 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume *volume, if (!icon) return NULL; - return get_pixbuf_from_gicon (icon, widget, icon_size, error); + pixbuf = get_pixbuf_from_gicon (icon, widget, icon_size, error); + + g_object_unref (icon); + + return pixbuf; } void |