diff options
author | Not Zed <NotZed@Ximian.com> | 2004-03-19 13:44:26 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-03-19 13:44:26 +0800 |
commit | 067979285b49a2cd3f0b878a3a6f8bf52fdbf2b6 (patch) | |
tree | a95377a2aff1d4b20404e8f466f7d56b364b4210 /camel | |
parent | 3907796ac1481040b67d84a7830054522111d56e (diff) | |
download | gsoc2013-evolution-067979285b49a2cd3f0b878a3a6f8bf52fdbf2b6.tar.gz gsoc2013-evolution-067979285b49a2cd3f0b878a3a6f8bf52fdbf2b6.tar.zst gsoc2013-evolution-067979285b49a2cd3f0b878a3a6f8bf52fdbf2b6.zip |
ref the diary before replaying it. it could get unreffed during replay if
2004-03-19 Not Zed <NotZed@Ximian.com>
* camel-disco-store.c (disco_connect): ref the diary before
replaying it. it could get unreffed during replay if there's an
error and we disconnect.
* camel-store.c (camel_store_get_folder): no longer use
folder_lock, we already have adequate serialisation code here or
below here. I hope.
(camel_store_get_folder_info): same here.
svn path=/trunk/; revision=25126
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 9 | ||||
-rw-r--r-- | camel/camel-disco-store.c | 9 | ||||
-rw-r--r-- | camel/camel-store.c | 7 |
3 files changed, 16 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index b75612447c..ed2de1a582 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,14 @@ 2004-03-19 Not Zed <NotZed@Ximian.com> + * camel-disco-store.c (disco_connect): ref the diary before + replaying it. it could get unreffed during replay if there's an + error and we disconnect. + + * camel-store.c (camel_store_get_folder): no longer use + folder_lock, we already have adequate serialisation code here or + below here. I hope. + (camel_store_get_folder_info): same here. + * providers/imap/camel-imap-store.h: remove async_thread thing. 2004-03-17 Jeffrey Stedfast <fejj@ximian.com> diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c index 02ac74cd3f..f674eb797c 100644 --- a/camel/camel-disco-store.c +++ b/camel/camel-disco-store.c @@ -140,6 +140,7 @@ disco_connect (CamelService *service, CamelException *ex) { CamelDiscoStore *store = CAMEL_DISCO_STORE (service); CamelDiscoStoreStatus status; + struct _CamelDiscoDiary *diary; status = camel_disco_store_status (store); if (status != CAMEL_DISCO_STORE_OFFLINE) { @@ -160,9 +161,13 @@ disco_connect (CamelService *service, CamelException *ex) if (camel_disco_diary_empty (store->diary)) return TRUE; - /* Need to resync */ + /* Need to resync. Note we do the ref thing since during the replay + disconnect could be called, which will remove store->diary and unref it */ store->status = CAMEL_DISCO_STORE_RESYNCING; - camel_disco_diary_replay (store->diary, ex); + diary = store->diary; + camel_object_ref(diary); + camel_disco_diary_replay(diary, ex); + camel_object_unref(diary); store->status = CAMEL_DISCO_STORE_ONLINE; if (camel_exception_is_set (ex)) return FALSE; diff --git a/camel/camel-store.c b/camel/camel-store.c index 38bfcc1e32..f4b96a1959 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -234,8 +234,6 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag if (!(flags & CAMEL_STORE_FOLDER_CREATE)) flags &= ~CAMEL_STORE_FOLDER_EXCL; - CAMEL_STORE_LOCK(store, folder_lock); - if (store->folders) { /* Try cache first. */ folder = camel_object_bag_reserve(store->folders, folder_name); @@ -281,8 +279,6 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag } } - CAMEL_STORE_UNLOCK(store, folder_lock); - return folder; } @@ -770,9 +766,7 @@ camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, C !(flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED), NULL); - CAMEL_STORE_LOCK(store, folder_lock); info = CS_CLASS (store)->get_folder_info (store, top, flags, ex); - CAMEL_STORE_UNLOCK(store, folder_lock); if (info && (top == NULL || *top == '\0') && (flags & CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL) == 0) { if (info->uri && (store->flags & CAMEL_STORE_VTRASH)) @@ -784,7 +778,6 @@ camel_store_get_folder_info(CamelStore *store, const char *top, guint32 flags, C return info; } - static void free_folder_info (CamelStore *store, CamelFolderInfo *fi) { |