From a2b972dbe497ad8fa4d8eeaef9e540b3b55a31c9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 19 Jun 2002 17:57:04 +0000 Subject: Make sure we hold the command_lock before accessing current_folder. 2002-06-19 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_refresh_info): Make sure we hold the command_lock before accessing current_folder. (imap_append_online): Same. (imap_transfer_online): Same. * providers/imap/camel-imap-store.c (delete_folder): We need to hold the command_lock before we can set the current_folder to NULL. (rename_folder): Same. (get_folder_info_online): We need to make sure we hold the command_lock in order to use current_folder. (everywhere): Same. svn path=/trunk/; revision=17233 --- camel/providers/imap/camel-imap-store.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'camel/providers/imap/camel-imap-store.c') diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 1e6284b572..f899168595 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -1409,10 +1409,14 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) if (response) { camel_imap_response_free_without_processing (imap_store, response); + CAMEL_IMAP_STORE_LOCK (imap_store, command_lock); + if (imap_store->current_folder) camel_object_unref (CAMEL_OBJECT (imap_store->current_folder)); /* no need to actually create a CamelFolder for INBOX */ imap_store->current_folder = NULL; + + CAMEL_IMAP_STORE_UNLOCK (imap_store, command_lock); } else return; @@ -1544,10 +1548,14 @@ rename_folder (CamelStore *store, const char *old_name, const char *new_name, Ca if (response) { camel_imap_response_free_without_processing (imap_store, response); + CAMEL_IMAP_STORE_LOCK (imap_store, command_lock); + if (imap_store->current_folder) camel_object_unref (CAMEL_OBJECT (imap_store->current_folder)); /* no need to actually create a CamelFolder for INBOX */ imap_store->current_folder = NULL; + + CAMEL_IMAP_STORE_UNLOCK (imap_store, command_lock); } else return; @@ -1993,6 +2001,7 @@ get_folder_info_online (CamelStore *store, const char *top, continue; } + CAMEL_IMAP_STORE_LOCK (imap_store, command_lock); /* For the current folder, poke it to check for new * messages and then report that number, rather than * doing a STATUS command. @@ -2003,6 +2012,8 @@ get_folder_info_online (CamelStore *store, const char *top, fi->unread_message_count = camel_folder_get_unread_message_count (imap_store->current_folder); } else fi->unread_message_count = get_folder_status (imap_store, fi->full_name, "UNSEEN"); + + CAMEL_IMAP_STORE_UNLOCK (imap_store, command_lock); } g_ptr_array_free (folders, TRUE); -- cgit v1.2.3