Leak patch for bonobo in gnome-1



The new pixmap cache adds a few leaks.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.1152
diff -u -w -r1.1152 ChangeLog
--- ChangeLog	2001/12/18 15:37:55	1.1152
+++ ChangeLog	2001/12/29 01:18:26
@@ -1,3 +1,9 @@
+2001-12-28  Jody Goldberg <jody gnome org>
+
+	* bonobo/bonobo-ui-util.c (bonobo_ui_util_xml_get_icon_pixbuf) :
+	  Don't leak the key, pixtype, or pixname when the cache lookup succeeds.
+	  Remove useless NULL test.
+
 2001-12-18  Michael Meeks  <michael ximian com>
 
 	* bonobo/bonobo-ui-util.c (bonobo_ui_util_new_ui): only
Index: bonobo/bonobo-ui-util.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-ui-util.c,v
retrieving revision 1.53
diff -u -w -r1.53 bonobo-ui-util.c
--- bonobo/bonobo-ui-util.c	2001/12/21 22:57:02	1.53
+++ bonobo/bonobo-ui-util.c	2001/12/29 01:18:27
@@ -443,15 +443,15 @@
 		return NULL;
 	}
 
-	if (!text)
-		return NULL;
-
 	key = g_strdup_printf ("%s!%s!%d", type, text, prepend_menu?1:0);
 
 	if (!pixbuf_cache)
 		pixbuf_cache = g_hash_table_new (g_str_hash, g_str_equal);
 
 	if ((icon_pixbuf = g_hash_table_lookup (pixbuf_cache, key))) {
+		g_free (key);
+		bonobo_ui_node_free_string (text);
+		bonobo_ui_node_free_string (type);
 		gdk_pixbuf_ref (icon_pixbuf);
 		return icon_pixbuf;
 	}



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