mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
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:
parent
d75ac50d93
commit
7bb440be2a
@ -38,8 +38,6 @@ class ApplicationPanel {
|
||||
this.panelWin = null;
|
||||
this.toolbox = null;
|
||||
this.emit("destroyed");
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,19 +74,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
|
||||
|
Loading…
Reference in New Issue
Block a user