aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-local-folder.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/local/camel-local-folder.c')
-rw-r--r--camel/providers/local/camel-local-folder.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 16ca2d8b2e..787b482169 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -138,9 +138,22 @@ local_finalize(CamelObject * object)
{
CamelLocalFolder *local_folder = CAMEL_LOCAL_FOLDER(object);
+ if (local_folder->summary) {
+ camel_local_summary_sync(local_folder->summary, FALSE, local_folder->changes, NULL);
+ camel_object_unref((CamelObject *)local_folder->summary);
+ }
+
+ if (local_folder->search) {
+ camel_object_unref((CamelObject *)local_folder->search);
+ }
+
+ /* must free index after summary, since it isn't refcounted */
if (local_folder->index)
ibex_close(local_folder->index);
+ while (local_folder->locked> 0)
+ camel_local_folder_unlock(local_folder);
+
g_free(local_folder->base_path);
g_free(local_folder->folder_path);
g_free(local_folder->summary_path);