[evolution-data-server] Bug #592310 - Deadlock in maildir provider after doing expunge



commit 03f4c1c3f8d0f88b49029d99efa8fd29ca869548
Author: Milan Crha <mcrha redhat com>
Date:   Fri Aug 21 08:37:29 2009 +0200

    Bug #592310 - Deadlock in maildir provider after doing expunge

 camel/camel-folder-summary.c                 |    4 +++-
 camel/providers/local/camel-maildir-folder.c |    7 -------
 camel/providers/local/camel-mh-folder.c      |    7 -------
 3 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 778b143..baf398b 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -3488,7 +3488,9 @@ message_info_free(CamelFolderSummary *s, CamelMessageInfo *info)
 	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
 
 	if (mi->uid) {
-		g_hash_table_remove (s->loaded_infos, mi->uid);
+		if (g_hash_table_lookup (s->loaded_infos, mi->uid) == mi) {
+			g_hash_table_remove (s->loaded_infos, mi->uid);
+		}
 		camel_pstring_free(mi->uid);
 	}
 	camel_pstring_free(mi->subject);
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 3279f1f..a8c4b28 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -179,9 +179,6 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
 	if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, ex) == -1)
 		return;
 
-	if (camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1)
-		goto check_changed;
-
 	/* add it to the summary/assign the uid, etc */
 	mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
 	if (camel_exception_is_set (ex))
@@ -287,10 +284,6 @@ maildir_get_message(CamelFolder * folder, const gchar * uid, CamelException * ex
 	if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, ex) == -1)
 		return NULL;
 
-	if (camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1) {
-		goto fail;
-	}
-
 	/* get the message summary info */
 	if ((info = camel_folder_summary_uid(folder->summary, uid)) == NULL) {
 		camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index e10f6aa..d4f2779 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -139,9 +139,6 @@ mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMe
 	if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, ex) == -1)
 		return;
 
-	if (camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1)
-		goto check_changed;
-
 	/* add it to the summary/assign the uid, etc */
 	mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
 	if (camel_exception_is_set (ex))
@@ -222,10 +219,6 @@ static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid,
 	if (camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, ex) == -1)
 		return NULL;
 
-	if (camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, ex) == -1) {
-		goto fail;
-	}
-
 	/* get the message summary info */
 	if ((info = camel_folder_summary_uid(folder->summary, uid)) == NULL) {
 		camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,



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