Bug 1118974 - Toolbox fails to shut down when highlighter actor is gone. r=pbrosset
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 26 Jan 2015 14:38:00 +0100
changeset 239601 50cc1ccc5132f60ae60d90220e8d9863b54ae0c1
parent 239451 7ddcf91ad7741521f87f10b4e7dfdb003749d23c
child 239602 27a7220c099b298f172c848a20fee9962829905c
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewerspbrosset
bugs1118974
milestone38.0a1
Bug 1118974 - Toolbox fails to shut down when highlighter actor is gone. r=pbrosset
browser/devtools/markupview/markup-view.js
--- a/browser/devtools/markupview/markup-view.js
+++ b/browser/devtools/markupview/markup-view.js
@@ -1289,19 +1289,23 @@ MarkupView.prototype = {
   /**
    * Tear down the markup panel.
    */
   destroy: function() {
     if (this._destroyer) {
       return this._destroyer;
     }
 
+    this._destroyer = promise.resolve();
+
     // Note that if the toolbox is closed, this will work fine, but will fail
     // in case the browser is closed and will trigger a noSuchActor message.
-    this._destroyer = this._hideBoxModel();
+    // We ignore the promise that |_hideBoxModel| returns, since we should still
+    // proceed with the rest of destruction if it fails.
+    this._hideBoxModel();
 
     this._elt.removeEventListener("click", this._onMouseClick, false);
 
     this._hoveredNode = null;
     this._inspector.toolbox.off("picker-node-hovered", this._onToolboxPickerHover);
 
     this.htmlEditor.destroy();
     this.htmlEditor = null;