diff --git a/chrome/content/zotero/xpcom/notifier.js b/chrome/content/zotero/xpcom/notifier.js index 9239b3c2ba..5de04301aa 100644 --- a/chrome/content/zotero/xpcom/notifier.js +++ b/chrome/content/zotero/xpcom/notifier.js @@ -153,11 +153,17 @@ Zotero.Notifier = new function () { continue; } + let ref = _observers[id].ref; + + if (Zotero.Debug.enabled && Zotero.Utilities.Internal.isObjectLeakingWindow(ref)) { + Zotero.warn(`Notifier observer with id '${id}' belongs to leaked window`); + } + // Catch exceptions so all observers get notified even if // one throws an error try { let t = new Date; - yield Zotero.Promise.resolve(_observers[id].ref.notify(event, type, ids, extraData)); + yield Zotero.Promise.resolve(ref.notify(event, type, ids, extraData)); t = new Date - t; if (t > 5) { //Zotero.debug(id + " observer finished in " + t + " ms", 5); diff --git a/chrome/content/zotero/xpcom/prefs.js b/chrome/content/zotero/xpcom/prefs.js index b1e64c0b45..c75352a8c4 100644 --- a/chrome/content/zotero/xpcom/prefs.js +++ b/chrome/content/zotero/xpcom/prefs.js @@ -402,10 +402,14 @@ Zotero.Prefs = new function() { return; } - var obs = _observers[data]; - for (var i=0; i