aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-23 14:16:23 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-23 14:16:23 +0800
commit6bb39b1f7d5f62675eb8ece5784f8e36edd339c5 (patch)
tree140a2798db382d461f55d34eb5fb38a3cb1aae2c
parent4609348bf23101ace41a984755bddd939ba7f4b7 (diff)
downloadgsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.tar
gsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.tar.gz
gsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.tar.bz2
gsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.tar.lz
gsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.tar.xz
gsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.tar.zst
gsoc2013-evolution-6bb39b1f7d5f62675eb8ece5784f8e36edd339c5.zip
connect lock around this. was getting a race with mem corruption
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. svn path=/trunk/; revision=25151
-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;
}