mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Stop observing idle after the database is closed permanently
A permanently closed connection kept its idle observer, so it went on being notified and attempting backups for the life of the process. This affects plugin databases, which are closed permanently when the plugin shuts down.
This commit is contained in:
parent
7243648ed7
commit
9e45191b22
1 changed files with 7 additions and 0 deletions
|
|
@ -1232,6 +1232,13 @@ Zotero.DBConnection.prototype.closeDatabase = async function (permanent) {
|
|||
this._connection = permanent ? false : null;
|
||||
Zotero.debug("Database closed");
|
||||
}
|
||||
|
||||
if (permanent && this._idleObserverRegistered) {
|
||||
this._idleObserverRegistered = false;
|
||||
Components.classes["@mozilla.org/widget/useridleservice;1"]
|
||||
.getService(Components.interfaces.nsIUserIdleService)
|
||||
.removeIdleObserver(this, this.IDLE_OBSERVER_SECONDS);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue