зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
df205ceebd
Коммит
6380398088
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче