From b125d06dc268441611b49c5e32dee81cd840f9a2 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 20 Mar 2001 05:58:35 +0000 Subject: Remove the node before freeing the data it points to. 2001-03-20 Christopher James Lahey * message-list.c (remove_node_diff, build_flat_diff): Remove the node before freeing the data it points to. svn path=/trunk/; revision=8841 --- mail/ChangeLog | 5 +++++ mail/message-list.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index aa7e6623be..1c218d0a03 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2001-03-20 Christopher James Lahey + + * message-list.c (remove_node_diff, build_flat_diff): Remove the + node before freeing the data it points to. + 2001-03-19 Christopher James Lahey * Merged e-tree-rework-branch: diff --git a/mail/message-list.c b/mail/message-list.c index 52c9e4da45..1a6248fa2c 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1565,14 +1565,14 @@ remove_node_diff(MessageList *ml, ETreePath node, int depth) /* and the rowid entry - if and only if it is referencing this node */ info = e_tree_memory_node_get_data(E_TREE_MEMORY (etm), node); - g_assert(info); - g_hash_table_remove(ml->uid_nodemap, camel_message_info_uid(info)); - camel_folder_free_message_info(ml->folder, info); - e_tree_memory_node_set_data(E_TREE_MEMORY(etm), node, NULL); /* and only at the toplevel, remove the node (etree should optimise this remove somewhat) */ if (depth == 0) e_tree_memory_node_remove(E_TREE_MEMORY(etm), node); + + g_assert(info); + g_hash_table_remove(ml->uid_nodemap, camel_message_info_uid(info)); + camel_folder_free_message_info(ml->folder, info); } /* applies a new tree structure to an existing tree, but only by changing things @@ -1776,9 +1776,9 @@ build_flat_diff(MessageList *ml, CamelFolderChangeInfo *changes) node = g_hash_table_lookup(ml->uid_nodemap, changes->uid_removed->pdata[i]); if (node) { info = e_tree_memory_node_get_data(E_TREE_MEMORY(ml->model), node); + e_tree_memory_node_remove(E_TREE_MEMORY(ml->model), node); camel_folder_free_message_info(ml->folder, info); g_hash_table_remove(ml->uid_nodemap, changes->uid_removed->pdata[i]); - e_tree_memory_node_remove(E_TREE_MEMORY(ml->model), node); } } -- cgit