aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index dbf0fce2e7..7abea71392 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -115,8 +115,8 @@ camel_store_init (void *o)
store->priv = g_malloc0 (sizeof (*store->priv));
#ifdef ENABLE_THREADS
- store->priv->folder_lock = g_mutex_new();
- store->priv->cache_lock = g_mutex_new();
+ store->priv->folder_lock = g_mutex_new ();
+ store->priv->cache_lock = g_mutex_new ();
#endif
}
@@ -204,9 +204,9 @@ CamelFolder *
camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex)
{
CamelFolder *folder = NULL;
-
+
CAMEL_STORE_LOCK(store, folder_lock);
-
+
if (store->folders) {
/* Try cache first. */
CAMEL_STORE_LOCK(store, cache_lock);
@@ -227,13 +227,14 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag
CAMEL_STORE_LOCK(store, cache_lock);
g_hash_table_insert (store->folders, g_strdup (folder_name), folder);
+ camel_object_ref (CAMEL_OBJECT (folder));
camel_object_hook_event (CAMEL_OBJECT (folder), "finalize", folder_finalize, store);
CAMEL_STORE_UNLOCK(store, cache_lock);
}
}
}
-
+
CAMEL_STORE_UNLOCK(store, folder_lock);
return folder;
}