diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 9d38793bf7..09abc03303 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -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); + } };