[evolution-patches] [Attachment-bar] Memory leak fix



Hi,

Attached is a patch that fixes a memory leak in e-attachment-bar.c that
I found in my valgrind runs.

Let me know you review comments

TIA,

V. Varadhan
Index: widgets/misc/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/ChangeLog,v
retrieving revision 1.376
diff -u -p -r1.376 ChangeLog
--- widgets/misc/ChangeLog	28 Sep 2005 11:35:31 -0000	1.376
+++ widgets/misc/ChangeLog	28 Sep 2005 12:31:30 -0000
@@ -1,3 +1,8 @@
+2005-09-28  Veerapuram Varadhan <vvaradhan novell com>
+
+	* e-attachment-bar.c (update): gtk_pixbuf_add_alpha returns a
+	newly allocated pixbuf, so, free the original one.
+	
 2005-09-28  Tor Lillqvist  <tml novell com>
 
 	* e-charset-picker.c (e_charset_picker_new,
Index: widgets/misc/e-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/e-attachment-bar.c,v
retrieving revision 1.9
diff -u -p -r1.9 e-attachment-bar.c
--- widgets/misc/e-attachment-bar.c	24 Aug 2005 04:22:14 -0000	1.9
+++ widgets/misc/e-attachment-bar.c	28 Sep 2005 12:32:24 -0000
@@ -361,7 +361,13 @@ update (EAttachmentBar *bar)
 		}
 
 		if (pixbuf) {
-			pixbuf = gdk_pixbuf_add_alpha (pixbuf, TRUE, 255, 255, 255);
+			GdkPixbuf* pixbuf_orig = pixbuf;
+			pixbuf = gdk_pixbuf_add_alpha (pixbuf_orig, TRUE, 255, 255, 255);
+
+			/* gdk_pixbuf_add_alpha returns a newly allocated pixbuf,
+			   free the original one. 
+			*/
+			g_object_unref (pixbuf_orig);
 
 			/* In case of a attachment bar, in a signed/encrypted part, display the status as a emblem*/
 			if (attachment->sign) {


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