[evolution-data-server/mmeeks-gdbus-import: 14/16] yet cleaner folder summary merging



commit 599d6b65232ee511cb68b2b7bba07ded89ab56a3
Author: Michael Meeks <michael meeks novell com>
Date:   Mon Mar 1 11:02:58 2010 +0000

    yet cleaner folder summary merging

 camel/camel-folder-summary.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index ece1387..7e86817 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -781,14 +781,10 @@ static gboolean
 remove_item (gchar *key, CamelMessageInfoBase *info, GSList **to_free_list)
 {
 	d(printf("%d(%d)\t", info->refcount, info->dirty)); /* camel_message_info_dump (info); */
-	CAMEL_SUMMARY_LOCK(info->summary, ref_lock);
 	if (info->refcount == 1 && !info->dirty && !(info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
-		CAMEL_SUMMARY_UNLOCK(info->summary, ref_lock);
-		/* free the entry later */
 		*to_free_list = g_slist_prepend (*to_free_list, info);
 		return TRUE;
 	}
-	CAMEL_SUMMARY_UNLOCK(info->summary, ref_lock);
 	return FALSE;
 }
 
@@ -816,7 +812,10 @@ remove_cache (CamelSession *session, CamelSessionThreadMsg *msg)
 	dd(printf("removing cache for  %s %d %p\n", s->folder ? s->folder->full_name : s->summary_path, g_hash_table_size (s->loaded_infos), (gpointer) s->loaded_infos));
 	/* FIXME[disk-summary] hack. fix it */
 	CAMEL_SUMMARY_LOCK (s, summary_lock);
+
+	CAMEL_SUMMARY_LOCK(s, ref_lock);
 	g_hash_table_foreach_remove  (s->loaded_infos, (GHRFunc) remove_item, &to_free_list);
+	CAMEL_SUMMARY_UNLOCK(s, ref_lock);
 
 	/* Deferred freeing as _free function will try to remove
 	   entries from the hash_table in foreach_remove otherwise */



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