www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit dd8c0ecf37bc9141779c61b0b801215a1a6ee94e
parent d0e4151e8e8f3e5d26c2e2cef5e57944d4eb63e2
Author: Simon Kornblith <simon@simonster.com>
Date:   Tue,  5 Nov 2013 15:20:48 -0500

Make sure we broadcast lockReleased on shutdown

Previously a startup error could result in the database being opened
and closed with no lockReleased message

Diffstat:
Mchrome/content/zotero/xpcom/db.js | 1+
Mchrome/content/zotero/xpcom/zotero.js | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git 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 @@ -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