summaryrefslogtreecommitdiff
path: root/gtk/gtkimage.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-09-17 18:09:13 +0000
committerChristian Persch <chpe@src.gnome.org>2008-09-17 18:09:13 +0000
commit7b533d04921e62361ce3455f1276cfee6fe73e84 (patch)
tree633c38f10fe2af7de2d2ad2fa9427b153a9de5ca /gtk/gtkimage.c
parent1df29bcae888dbaeaa18555efdb514d52852a969 (diff)
downloadgtk+-7b533d04921e62361ce3455f1276cfee6fe73e84.tar.gz
Bug 552667 – gtkimage containing gicon leaks memory
* gtk/gtkimage.c: (ensure_pixbuf_for_gicon): Fix critical warnings when looking up the icon fails. Plug a mem leak. svn path=/trunk/; revision=21415
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r--gtk/gtkimage.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 9f4b111362..15f3bb27d9 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1611,7 +1611,6 @@ ensure_pixbuf_for_gicon (GtkImage *image)
gint width, height;
GtkIconInfo *info;
GtkIconLookupFlags flags;
- GError *error = NULL;
g_return_if_fail (image->storage_type == GTK_IMAGE_GICON);
@@ -1643,10 +1642,14 @@ ensure_pixbuf_for_gicon (GtkImage *image)
info = gtk_icon_theme_lookup_by_gicon (icon_theme,
image->data.gicon.icon,
MIN (width, height), flags);
- image->data.gicon.pixbuf = gtk_icon_info_load_icon (info, &error);
+ if (info)
+ {
+ image->data.gicon.pixbuf = gtk_icon_info_load_icon (info, NULL);
+ gtk_icon_info_free (info);
+ }
+
if (image->data.gicon.pixbuf == NULL)
{
- g_error_free (error);
image->data.gicon.pixbuf =
gtk_widget_render_icon (GTK_WIDGET (image),
GTK_STOCK_MISSING_IMAGE,