← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/indicator-messages/mem-leaks into lp:indicator-messages

 

Ted Gould has proposed merging lp:~ted/indicator-messages/mem-leaks into lp:indicator-messages.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  #690668 libindicate, libdbusmenu, indicator-messages-service memleaks
  https://bugs.launchpad.net/bugs/690668

For more details, see:
https://code.launchpad.net/~ted/indicator-messages/mem-leaks/+merge/47088

Patch from ~hyperair for bug 690668
-- 
https://code.launchpad.net/~ted/indicator-messages/mem-leaks/+merge/47088
Your team ayatana-commits is subscribed to branch lp:indicator-messages.
=== modified file 'src/indicator-messages.c'
--- src/indicator-messages.c	2011-01-14 19:10:10 +0000
+++ src/indicator-messages.c	2011-01-21 20:08:53 +0000
@@ -571,6 +571,7 @@
 				                                         width,
 				                                         height,
 				                                         GDK_INTERP_BILINEAR);
+				g_object_unref(pixbuf);
 			} else {
 				g_debug("Happy with icon sized %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));
 				resized_pixbuf = pixbuf;
@@ -578,10 +579,7 @@
 	  
 			gtk_image_set_from_pixbuf(GTK_IMAGE(mi_data->icon), resized_pixbuf);
 
-			/* The other pixbuf should be free'd by the dbusmenu. */
-			if (resized_pixbuf != pixbuf) {
-				g_object_unref(resized_pixbuf);
-			}
+			g_object_unref(resized_pixbuf);
 
 			gtk_widget_show(mi_data->icon);
 		} else {
@@ -633,6 +631,7 @@
 			                                         width,
 			                                         height,
 			                                         GDK_INTERP_BILINEAR);
+			g_object_unref(pixbuf);
 		} else {
 			g_debug("Happy with icon sized %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf));
 			resized_pixbuf = pixbuf;
@@ -640,10 +639,7 @@
   
 		gtk_image_set_from_pixbuf(GTK_IMAGE(mi_data->icon), resized_pixbuf);
 
-		/* The other pixbuf should be free'd by the dbusmenu. */
-		if (resized_pixbuf != pixbuf) {
-			g_object_unref(resized_pixbuf);
-		}
+		g_object_unref(resized_pixbuf);
 	}
 	gtk_misc_set_alignment(GTK_MISC(mi_data->icon), 0.0, 0.5);
 	gtk_box_pack_start(GTK_BOX(hbox), mi_data->icon, FALSE, FALSE, padding);


Follow ups