From dd8c0ecf37bc9141779c61b0b801215a1a6ee94e Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 5 Nov 2013 15:20:48 -0500 Subject: [PATCH] Make sure we broadcast lockReleased on shutdown Previously a startup error could result in the database being opened and closed with no lockReleased message --- chrome/content/zotero/xpcom/db.js | 1 + chrome/content/zotero/xpcom/zotero.js | 2 +- styles | 2 +- translators | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 16cc74877..837800845 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -796,6 +796,7 @@ Zotero.DBConnection.prototype.closeDatabase = function () { this.stopDummyStatement(); var deferred = Q.defer(); this._connection.asyncClose(deferred.resolve); + this._connection = undefined; return deferred.promise; } else { return Q(); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 04a540d8d..795824a3e 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -808,7 +808,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); // remove temp directory Zotero.removeTempDirectory(); - if(Zotero.initialized && Zotero.DB) { + if(Zotero.DB && Zotero.DB._connection) { Zotero.debug("Closing database"); // run GC to finalize open statements diff --git a/styles b/styles index 01e0f42ae..c536a2c5c 160000 --- a/styles +++ b/styles @@ -1 +1 @@ -Subproject commit 01e0f42aee7595b7cccafe731de57f277c2b76df +Subproject commit c536a2c5c28ca465b511733a849ae452822fd363 diff --git a/translators b/translators index 330bcfa0a..6fcf964bf 160000 --- a/translators +++ b/translators @@ -1 +1 @@ -Subproject commit 330bcfa0ab1c501b71d82d56b1cad88523cea722 +Subproject commit 6fcf964bf91100f087d84f714c65f89b1f50397c