aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/providers/imap/camel-imap-store.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 7785ce9db1..dd0cf84034 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-23 Not Zed <NotZed@Ximian.com>
+
+ * providers/imap/camel-imap-store.c (get_folder_info_online):
+ connect lock around this. was getting a race with mem corruption
+ otherwise.
+
2004-03-22 Not Zed <NotZed@Ximian.com>
* camel-mime-utils.c (camel_header_newsgroups_decode)
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index adca07651f..b9ced3e01b 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -2593,12 +2593,14 @@ static CamelFolderInfo *
get_folder_info_online (CamelStore *store, const char *top, guint32 flags, CamelException *ex)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
- CamelFolderInfo *tree;
+ CamelFolderInfo *tree = NULL;
GPtrArray *folders;
if (top == NULL)
top = "";
+ CAMEL_SERVICE_LOCK(store, connect_lock);
+
if ((flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
&& !(imap_store->capabilities & IMAP_CAPABILITY_useful_lsub)
&& (imap_store->parameters & IMAP_PARAM_CHECK_ALL))
@@ -2607,7 +2609,7 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
folders = get_folders(store, top, flags, ex);
if (folders == NULL)
- return NULL;
+ goto done;
tree = camel_folder_info_build(folders, top, '/', TRUE);
g_ptr_array_free(folders, TRUE);
@@ -2617,6 +2619,8 @@ get_folder_info_online (CamelStore *store, const char *top, guint32 flags, Camel
d(dumpfi(tree));
camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
+done:
+ CAMEL_SERVICE_UNLOCK(store, connect_lock);
return tree;
}