Re: [evolution-patches] giant folder thread leak fix.



On Sat, 2003-06-14 at 01:44, Not Zed wrote:
> On Sat, 2003-06-14 at 15:43, Larry Ewing wrote:
> > This fixes the big leak that was making the mailer grow quickly.  An
> > alternate version is to destroy and recreate the memchunk store so that
> > it can actually shrink, I'll happily do that upon request.
> > 
> > --Larry
> > 
> 
> Looks good.  Duh :-/
> 
> On consideration ... it might make sense to destroy/recreate it while
> we're at it.
> 
> 
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches

How does this look then?

--Larry

? camel-mime-filter-enriched.c.new
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.1829
diff -u -p -r1.1829 ChangeLog
--- ChangeLog	13 Jun 2003 19:06:50 -0000	1.1829
+++ ChangeLog	16 Jun 2003 19:18:48 -0000
@@ -1,3 +1,9 @@
+2003-06-13  Larry Ewing  <lewing ximian com>
+
+	* camel-folder-thread.c (camel_folder_thread_messages_apply):
+	don't leak the summary when reloading it.  Fixes a very large
+	leak.
+
 2003-06-05  Jeffrey Stedfast  <fejj ximian com>
 
 	Fix for bug #40788.
Index: camel-folder-thread.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-folder-thread.c,v
retrieving revision 1.17
diff -u -p -r1.17 camel-folder-thread.c
--- camel-folder-thread.c	27 Aug 2002 21:45:22 -0000	1.17
+++ camel-folder-thread.c	16 Jun 2003 19:18:49 -0000
@@ -662,6 +662,10 @@ camel_folder_thread_messages_apply(Camel
 			g_ptr_array_add(all, info);
 
 	g_hash_table_destroy(table);
+
+	thread->tree = NULL;
+	e_memchunk_destroy(thread->node_chunks);
+	thread->node_chunks = e_memchunk_new(32, sizeof(CamelFolderThreadNode));
 	thread_summary(thread, all);
 
 	g_ptr_array_free(thread->summary, TRUE);
@@ -777,7 +781,7 @@ camel_folder_thread_messages_add(CamelFo
 	/* reset the tree, and rebuild fully */
 	thread->tree = NULL;
 	e_memchunk_empty(thread->node_chunks);
-	thread_summary(thread, all, NULL);
+	thread_summary(thread, all);
 }
 
 static void


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