Commit 00643d0c authored by Alexandre Poirot's avatar Alexandre Poirot
Browse files

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
parent 0284ed4b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -38,8 +38,6 @@ class ApplicationPanel {
    this.panelWin = null;
    this.toolbox = null;
    this.emit("destroyed");

    return this;
  }
}

+6 −10
Original line number Diff line number Diff line
@@ -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.emit("destroyed");
      resolve();
    });

    return this._destroying;
  },

  // Events