From fad86a267fd3c0ebc402ca67f14a0d2f74f57b74 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 4 May 2009 09:40:18 +0530 Subject: =?UTF-8?q?**=20BUGFIX:=20569696=20=E2=80=93=20Memory=20leak=20in?= =?UTF-8?q?=20message-list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not exactly a leak, but a build-up over a period of time. Clear the internal gnode on regen. --- mail/message-list.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/message-list.c b/mail/message-list.c index 3027fcf3e8..68177535e2 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2584,7 +2584,7 @@ clear_info(char *key, ETreePath *node, MessageList *ml) } static void -clear_tree (MessageList *ml) +clear_tree (MessageList *ml, gboolean tfree) { ETreeModel *etm = ml->model; @@ -2608,7 +2608,8 @@ clear_tree (MessageList *ml) } ml->tree_root = e_tree_memory_node_insert (E_TREE_MEMORY(etm), NULL, 0, NULL); - + if (tfree) + e_tree_model_rebuilt (E_TREE_MODEL(etm)); #ifdef TIMEIT gettimeofday(&end, NULL); diff = end.tv_sec * 1000 + end.tv_usec/1000; @@ -2769,7 +2770,7 @@ build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *c selected = message_list_get_selected(ml); #endif e_tree_memory_freeze(E_TREE_MEMORY(etm)); - clear_tree (ml); + clear_tree (ml, FALSE); build_subtree(ml, ml->tree_root, thread->tree, &row); e_tree_memory_thaw(E_TREE_MEMORY(etm)); @@ -3088,7 +3089,7 @@ build_flat (MessageList *ml, GPtrArray *summary, CamelFolderChangeInfo *changes) selected = message_list_get_selected(ml); #endif e_tree_memory_freeze(E_TREE_MEMORY(etm)); - clear_tree (ml); + clear_tree (ml, FALSE); for (i = 0; i < summary->len; i++) { ETreePath node; CamelMessageInfo *info = summary->pdata[i]; @@ -3354,7 +3355,7 @@ message_list_set_folder (MessageList *message_list, CamelFolder *folder, const c } e_tree_memory_freeze(E_TREE_MEMORY(etm)); - clear_tree (message_list); + clear_tree (message_list, TRUE); e_tree_memory_thaw(E_TREE_MEMORY(etm)); if (message_list->folder) { -- cgit v1.2.3