[evolution] Bug #687412 - Crash under mail_folder_cache_service_removed()



commit 1c35d94851adfab4340464376118eea4d964fc8d
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 25 14:16:36 2013 +0100

    Bug #687412 - Crash under mail_folder_cache_service_removed()

 libemail-engine/mail-folder-cache.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index 2f99e84..2bf0bb4 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -841,13 +841,13 @@ update_folders (CamelStore *store,
 
        g_rec_mutex_lock (&ud->cache->priv->stores_mutex);
        si = g_hash_table_lookup (ud->cache->priv->stores, store);
-       if (si && !g_cancellable_is_cancelled (ud->cancellable)) {
+       if (si) {
                /* The 'si' is still there, so we can remove ourselves from
                 * its list.  Or else its not, and we're on our own and free
                 * anyway. */
                g_queue_remove (&si->folderinfo_updates, ud);
 
-               if (fi != NULL)
+               if (fi != NULL && !g_cancellable_is_cancelled (ud->cancellable))
                        create_folders (ud->cache, fi, si);
        }
        g_rec_mutex_unlock (&ud->cache->priv->stores_mutex);
@@ -998,6 +998,12 @@ store_go_online_cb (CamelStore *store,
                                G_PRIORITY_DEFAULT, ud->cancellable,
                                (GAsyncReadyCallback) update_folders, ud);
        } else {
+               StoreInfo *si;
+
+               si = g_hash_table_lookup (ud->cache->priv->stores, store);
+               if (si)
+                       g_queue_remove (&si->folderinfo_updates, ud);
+
                /* The store vanished, that means we were probably cancelled,
                 * or at any rate, need to clean ourselves up. */
                if (ud->cancellable != NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]