Bug 1091851 - Fix a race condition in Sqlite.jsm shutdown. r=mak

--HG--
extra : rebase_source : 5127daecf96c3aaebc60f15a4b713273cee5e78f
This commit is contained in:
David Rajchenbach-Teller 2015-06-04 15:09:37 +02:00
parent 89fee48aee
commit b0ba024008

View File

@ -442,7 +442,6 @@ ConnectionData.prototype = Object.freeze({
// necessarily at the mozStorage-level.
let markAsClosed = () => {
this._log.info("Closed");
this._dbConn = null;
// Now that the connection is closed, no need to keep
// a blocker for Barriers.connections.
Barriers.connections.client.removeBlocker(this._deferredClose.promise);
@ -450,10 +449,12 @@ ConnectionData.prototype = Object.freeze({
}
if (wrappedConnections.has(this._identifier)) {
wrappedConnections.delete(this._identifier);
this._dbConn = null;
markAsClosed();
} else {
this._log.debug("Calling asyncClose().");
this._dbConn.asyncClose(markAsClosed);
this._dbConn = null;
}
return this._deferredClose.promise;
},