Bug 1302148 - Nullify attributes on destroy to prevent leaking the toolbox. r=bgrins
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 12 Sep 2016 03:21:40 -0700
changeset 314416 cbe6f8892338d106afe6e49ea5425f380935858d
parent 314415 9b321d41d837235eecd2d5c9a5b40d861a22d55b
child 314417 d772aeb63c38a896a00453229e309601dae88c35
push id20574
push usercbook@mozilla.com
push dateTue, 20 Sep 2016 10:05:16 +0000
treeherderfx-team@14705f779a46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1302148
milestone51.0a1
Bug 1302148 - Nullify attributes on destroy to prevent leaking the toolbox. r=bgrins MozReview-Commit-ID: AUsgbyi9KNQ
devtools/client/framework/target.js
devtools/client/framework/toolbox-hosts.js
devtools/client/webconsole/panel.js
--- a/devtools/client/framework/target.js
+++ b/devtools/client/framework/target.js
@@ -614,16 +614,19 @@ TabTarget.prototype = {
 
     this.activeTab = null;
     this.activeConsole = null;
     this._client = null;
     this._tab = null;
     this._form = null;
     this._remote = null;
     this._root = null;
+    this._title = null;
+    this._url = null;
+    this.threadActor = null;
   },
 
   toString: function () {
     let id = this._tab ? this._tab : (this._form && this._form.actor);
     return `TabTarget:${id}`;
   },
 
   /**
--- a/devtools/client/framework/toolbox-hosts.js
+++ b/devtools/client/framework/toolbox-hosts.js
@@ -168,16 +168,19 @@ BottomHost.prototype = {
    */
   destroy: function () {
     if (!this._destroyed) {
       this._destroyed = true;
 
       Services.prefs.setIntPref(this.heightPref, this.frame.height);
       this._nbox.removeChild(this._splitter);
       this._nbox.removeChild(this.frame);
+      this.frame = null;
+      this._nbox = null;
+      this._splitter = null;
     }
 
     return promise.resolve(null);
   }
 };
 
 /**
  * Host object for the in-browser sidebar
--- a/devtools/client/webconsole/panel.js
+++ b/devtools/client/webconsole/panel.js
@@ -102,13 +102,17 @@ WebConsolePanel.prototype = {
   },
 
   destroy: function () {
     if (this._destroyer) {
       return this._destroyer;
     }
 
     this._destroyer = this.hud.destroy();
-    this._destroyer.then(() => this.emit("destroyed"));
+    this._destroyer.then(() => {
+      this._frameWindow = null;
+      this._toolbox = null;
+      this.emit("destroyed");
+    });
 
     return this._destroyer;
   },
 };