Bug 1520075 - Store the window reference on the child actors as a weak reference. r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D19850

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Felipe Gomes 2019-02-21 17:58:33 +00:00
Родитель df205ceebd
Коммит 6380398088
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -63,6 +63,8 @@ class Dispatcher {
for (let topic of this.observers.keys()) {
Services.obs.removeObserver(this, topic);
}
this.mm.removeEventListener("unload", this);
}
get window() {
@ -187,7 +189,7 @@ class SingletonDispatcher extends Dispatcher {
window.addEventListener("pageshow", this, {mozSystemGroup: true});
window.addEventListener("pagehide", this, {mozSystemGroup: true});
this._window = window;
this._window = Cu.getWeakReference(window);
this.listeners = [];
}
@ -227,7 +229,7 @@ class SingletonDispatcher extends Dispatcher {
}
get window() {
return this._window;
return this._window.get();
}
handleEvent(event) {