Bug #721286 - IMAPx: read messages become unread when reopening Evolution ][
authorMilan Crha <mcrha@redhat.com>
Wed, 29 Jan 2014 18:54:44 +0000 (19:54 +0100)
committerMilan Crha <mcrha@redhat.com>
Wed, 29 Jan 2014 18:54:44 +0000 (19:54 +0100)
Found one more issue when testing the same change for gnome-3-10:

d) do not use CamelOperation in the parser thread, because it can be
   cancelled at an application end with camel_operation_cancel_all() call,
   which is done too early, before any pending jobs are properly finished
   (it can be IDLE job, or save of folder changes back to the server)

camel/providers/imapx/camel-imapx-server.c

index 2c7ef52..76399f9 100644 (file)
@@ -7401,7 +7401,12 @@ imapx_parser_thread (gpointer user_data)
 
        is = CAMEL_IMAPX_SERVER (user_data);
 
-       cancellable = camel_operation_new ();
+       /* Do not use CamelOperation here, because it can be cancelled at
+          an application end with camel_operation_cancel_all() call, which
+          is done too early, before any pending jobs are properly finished
+          (it can be IDLE job, or save of folder changes back to the server).
+        */
+       cancellable = g_cancellable_new ();
        g_weak_ref_set (&is->priv->parser_cancellable, cancellable);
 
        stream = camel_imapx_server_ref_stream (is);