зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1569676 - Make DOM and application panel's destroy synchronous. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D39709 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0284ed4bdb
Коммит
00643d0c50
|
@ -38,8 +38,6 @@ class ApplicationPanel {
|
|||
this.panelWin = null;
|
||||
this.toolbox = null;
|
||||
this.emit("destroyed");
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,19 +89,15 @@ DomPanel.prototype = {
|
|||
},
|
||||
|
||||
destroy() {
|
||||
if (this._destroying) {
|
||||
return this._destroying;
|
||||
if (this._destroyed) {
|
||||
return;
|
||||
}
|
||||
this._destroyed = true;
|
||||
|
||||
this._destroying = new Promise(resolve => {
|
||||
this.target.off("navigate", this.onTabNavigated);
|
||||
this._toolbox.off("select", this.onPanelVisibilityChange);
|
||||
this.target.off("navigate", this.onTabNavigated);
|
||||
this._toolbox.off("select", this.onPanelVisibilityChange);
|
||||
|
||||
this.emit("destroyed");
|
||||
resolve();
|
||||
});
|
||||
|
||||
return this._destroying;
|
||||
this.emit("destroyed");
|
||||
},
|
||||
|
||||
// Events
|
||||
|
|
Загрузка…
Ссылка в новой задаче