diff options
Diffstat (limited to 'camel/camel-vee-folder.c')
-rw-r--r-- | camel/camel-vee-folder.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c index dc18d5e478..3f05626ceb 100644 --- a/camel/camel-vee-folder.c +++ b/camel/camel-vee-folder.c @@ -527,16 +527,18 @@ vee_sync(CamelFolder *folder, gboolean expunge, CamelException *ex) if (camel_exception_is_set(ex)) break; - if (vee_folder_build_folder(vf, f, ex) == -1) + if (expunge && vee_folder_build_folder(vf, f, ex) == -1) break; node = node->next; } - CAMEL_VEE_FOLDER_LOCK(vf, changed_lock); - g_list_free(p->folders_changed); - p->folders_changed = NULL; - CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock); + if (expunge && node == NULL) { + CAMEL_VEE_FOLDER_LOCK(vf, changed_lock); + g_list_free(p->folders_changed); + p->folders_changed = NULL; + CAMEL_VEE_FOLDER_UNLOCK(vf, changed_lock); + } CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock); } |