[evolution-data-server] [IMAPx] Do not update mailboxes on exit which were not entered yet



commit d83520bc88cc1a39256fe03174d0885d9fd97ac5
Author: Milan Crha <mcrha redhat com>
Date:   Wed Feb 11 17:15:08 2015 +0100

    [IMAPx] Do not update mailboxes on exit which were not entered yet
    
    This is kind of regression after changes for bug #691465, which caches
    all CamelFolder structures, but doesn't enter them. The problem was
    a slow shutdown, due to synchronizing all known folders, not only
    those which could be changed.

 camel/providers/imapx/camel-imapx-folder.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 2635ec3..393de5b 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -42,6 +42,8 @@
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolderPrivate))
 
+extern gint camel_application_is_exiting;
+
 struct _CamelIMAPXFolderPrivate {
        GMutex property_lock;
        GWeakRef mailbox;
@@ -1115,9 +1117,12 @@ imapx_synchronize_sync (CamelFolder *folder,
        if (imapx_server == NULL)
                goto exit;
 
-       mailbox = camel_imapx_folder_list_mailbox (
-               CAMEL_IMAPX_FOLDER (folder), cancellable, error);
-       if (mailbox == NULL) {
+       mailbox = camel_imapx_folder_list_mailbox (CAMEL_IMAPX_FOLDER (folder), cancellable, error);
+
+       /* Do not update mailboxes on exit which were not entered yet */
+       if (mailbox == NULL || (camel_application_is_exiting &&
+           camel_imapx_mailbox_get_permanentflags (mailbox) == ~0)) {
+               success = mailbox != NULL;
                camel_imapx_store_folder_op_done (imapx_store, imapx_server, folder_name);
                goto exit;
        }


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