diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-14 06:17:00 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-14 06:17:00 +0800 |
commit | 106b05d139f79a88dfb0878157da074830af2904 (patch) | |
tree | f595d6c03ea6dde32e21c726026cca7581ab0736 /camel/camel-store.c | |
parent | 681cee1a1d0000f865f96624299afc917975bc45 (diff) | |
download | gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.tar gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.tar.gz gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.tar.bz2 gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.tar.lz gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.tar.xz gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.tar.zst gsoc2013-evolution-106b05d139f79a88dfb0878157da074830af2904.zip |
We need to be ref'ing the folder if/when we add it to the hash. This may
2001-08-13 Jeffrey Stedfast <fejj@ximian.com>
* camel-store.c (camel_store_get_folder): We need to be ref'ing
the folder if/when we add it to the hash. This may fix bug #6089?
svn path=/trunk/; revision=11968
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r-- | camel/camel-store.c | 11 |
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; } |