[geary/wip/intermittitent-ci-test-failures-redux] Cancel background tasks in ImapDB.Account before the DB when closing



commit b6c4ff158cbd3832401157c796c1c6ca2514ad52
Author: Michael Gratton <mike vee net>
Date:   Thu Feb 14 13:32:12 2019 +1100

    Cancel background tasks in ImapDB.Account before the DB when closing
    
    The tasks may be using the DB, so stop them so they stop using the db.

 src/engine/imap-db/imap-db-account.vala | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/engine/imap-db/imap-db-account.vala b/src/engine/imap-db/imap-db-account.vala
index f1f83650..063817ee 100644
--- a/src/engine/imap-db/imap-db-account.vala
+++ b/src/engine/imap-db/imap-db-account.vala
@@ -360,18 +360,18 @@ private class Geary.ImapDB.Account : BaseObject {
     public async void close_async(Cancellable? cancellable) throws Error {
         if (db == null)
             return;
-        
+
+        this.background_cancellable.cancel();
+        this.background_cancellable = null;
+
+        this.folder_refs.clear();
+
         // close and always drop reference
         try {
             db.close(cancellable);
         } finally {
             db = null;
         }
-
-        this.background_cancellable.cancel();
-        this.background_cancellable = null;
-
-        this.folder_refs.clear();
     }
 
     public async Folder clone_folder_async(Geary.Imap.Folder imap_folder,


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