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:
Alexandre Poirot 2019-08-12 13:47:07 +00:00
Родитель 0284ed4bdb
Коммит 00643d0c50
2 изменённых файлов: 6 добавлений и 12 удалений

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

@ -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