mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 919535 - Use AsyncShutdown in Sqlite.jsm. r=Yoric
This commit is contained in:
parent
9ddf4f6916
commit
6560ac9c5c
@ -16,6 +16,8 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
|
||||
"resource://services-common/utils.js");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
@ -197,6 +199,7 @@ function OpenedConnection(connection, basename, number, options) {
|
||||
this._log.info("Opened");
|
||||
|
||||
this._connection = connection;
|
||||
this._connectionIdentifier = basename + " Conn #" + number;
|
||||
this._open = true;
|
||||
|
||||
this._cachedStatements = new Map();
|
||||
@ -282,6 +285,11 @@ OpenedConnection.prototype = Object.freeze({
|
||||
this._clearIdleShrinkTimer();
|
||||
let deferred = Promise.defer();
|
||||
|
||||
AsyncShutdown.profileBeforeChange.addBlocker(
|
||||
"Sqlite.jsm: " + this._connectionIdentifier,
|
||||
deferred.promise
|
||||
);
|
||||
|
||||
// We need to take extra care with transactions during shutdown.
|
||||
//
|
||||
// If we don't have a transaction in progress, we can proceed with shutdown
|
||||
|
Loading…
Reference in New Issue
Block a user