[evolution-patches] Re: Addressbook UI leaks



On Wed, 2005-04-27 at 15:20 +0100, Ross Burton wrote:
> I noticed that evolution was taking quite a lot of memory, and quickly
> investigated a hunch that there was a leak in the address book UI.
> 
> I grabbed CVS and fixed two obvious leaks from the valgrind trace, but
> sadly I'm unable to build evolution itself at the moment so if someone
> could check that these one-liners don't make anything die that would be
> great. :)

Attached is a revised patch which fixes another two leaks.

Again sadly this hasn't been compiled yet. :(

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Index: addressbook/gui/widgets/e-addressbook-view.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/e-addressbook-view.c,v
retrieving revision 1.159
diff -u -r1.159 e-addressbook-view.c
--- addressbook/gui/widgets/e-addressbook-view.c	28 Feb 2005 22:20:08 -0000	1.159
+++ addressbook/gui/widgets/e-addressbook-view.c	27 Apr 2005 14:34:06 -0000
@@ -368,6 +368,16 @@
 		eav->invisible = NULL;
 	}
 
+	if (eav->search_context) {
+		g_object_unref (eav->search_context);
+		eav->search_context = NULL;
+	}
+
+	if (eav->search_rule) {
+		g_object_unref (eav->search_rule);
+		eav->search_rule = NULL;
+	}
+
 	if (eav->ecml_changed_id != 0) {
 		g_signal_handler_disconnect (get_master_list(),
 					     eav->ecml_changed_id);
Index: addressbook/gui/widgets/eab-contact-display.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/eab-contact-display.c,v
retrieving revision 1.19
diff -u -r1.19 eab-contact-display.c
--- addressbook/gui/widgets/eab-contact-display.c	24 Jan 2005 17:28:37 -0000	1.19
+++ addressbook/gui/widgets/eab-contact-display.c	27 Apr 2005 14:34:06 -0000
@@ -75,6 +75,8 @@
 		gtk_html_stream_write (handle, photo->data, photo->length);
 
 		gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
+
+		e_contact_photo_free (photo);
 	}
 	else if (!strncmp (url, "evo-icon:", strlen ("evo-icon:"))) {
 		gchar *data;
@@ -435,7 +437,7 @@
 		}
 
 
-		if (e_contact_get (contact, E_CONTACT_IS_LIST))
+		if (e_contact_get_const (contact, E_CONTACT_IS_LIST))
 			render_contact_list (html_stream, contact);
 		else
 			render_contact (html_stream, contact);


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