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 314483 cbe6f8892338d106afe6e49ea5425f380935858d
parent 314482 9b321d41d837235eecd2d5c9a5b40d861a22d55b
child 314484 d772aeb63c38a896a00453229e309601dae88c35
push id81903
push usercbook@mozilla.com
push dateTue, 20 Sep 2016 10:04:26 +0000
treeherdermozilla-inbound@150109898e5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1302148
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
   },
 };