From fa680bbbf5efa5e11941a81ef1b07dd15e034f59 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 26 Feb 2017 06:12:45 -0500 Subject: [PATCH] Fix startup error on Windows DB upgrades caused by b2b751e0a0 --- chrome/content/zotero/xpcom/db.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 22f086cc22..f98c76087f 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -1064,6 +1064,17 @@ Zotero.DBConnection.prototype.backupDatabase = Zotero.Promise.coroutine(function } return false; } + finally { + if (connection) { + let deferred = Zotero.Promise.defer(); + connection.asyncClose({ + complete: function () { + deferred.resolve(); + } + }); + yield deferred.promise; + } + } // Special backup if (!suffix && numBackups > 1) {