diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |