gtk+ r21415 - in trunk: . gtk



Author: chpe
Date: Wed Sep 17 18:09:13 2008
New Revision: 21415
URL: http://svn.gnome.org/viewvc/gtk+?rev=21415&view=rev

Log:
	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.

Modified:
   trunk/ChangeLog
   trunk/gtk/gtkimage.c

Modified: trunk/gtk/gtkimage.c
==============================================================================
--- trunk/gtk/gtkimage.c	(original)
+++ trunk/gtk/gtkimage.c	Wed Sep 17 18:09:13 2008
@@ -1611,7 +1611,6 @@
   gint width, height;
   GtkIconInfo *info;
   GtkIconLookupFlags flags;
-  GError *error = NULL;
 
   g_return_if_fail (image->storage_type == GTK_IMAGE_GICON);
 
@@ -1643,10 +1642,14 @@
       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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]