Bug 917982 - The ThreadActor's threadLifetimePool should actually have the same lifetime as the thread; r=jimb
authorNick Fitzgerald <fitzgen@gmail.com>
Thu, 05 Dec 2013 16:33:53 -0800
changeset 174805 96af68a913f468febf09cf1e031a39ee8dce439d
parent 174804 3ef4df94f3dd8cadc4643417847ec4e1f960c26e
child 174806 f118b840cabe5a9bd752ea45081006358674566a
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs917982
milestone28.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 917982 - The ThreadActor's threadLifetimePool should actually have the same lifetime as the thread; r=jimb
toolkit/devtools/server/actors/script.js
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -522,22 +522,23 @@ ThreadActor.prototype = {
     eventLoop.enter();
   },
   _popThreadPause: function () {
     const eventLoop = this._threadPauseEventLoops.pop();
     dbg_assert(eventLoop, "Should have an event loop.");
     eventLoop.resolve();
   },
 
+  /**
+   * Remove all debuggees and clear out the thread's sources.
+   */
   clearDebuggees: function () {
     if (this.dbg) {
       this.dbg.removeAllDebuggees();
     }
-    this.conn.removeActorPool(this._threadLifetimePool || undefined);
-    this._threadLifetimePool = null;
     this._sources = null;
   },
 
   /**
    * Add a debuggee global to the Debugger object.
    *
    * @returns the Debugger.Object that corresponds to the global.
    */
@@ -631,16 +632,18 @@ ThreadActor.prototype = {
     dumpn("in ThreadActor.prototype.disconnect");
     if (this._state == "paused") {
       this.onResume();
     }
 
     this._state = "exited";
 
     this.clearDebuggees();
+    this.conn.removeActorPool(this._threadLifetimePool);
+    this._threadLifetimePool = null;
 
     if (this._prettyPrintWorker) {
       this._prettyPrintWorker.removeEventListener(
         "error", this._onPrettyPrintError, false);
       this._prettyPrintWorker.removeEventListener(
         "message", this._onPrettyPrintMsg, false);
       this._prettyPrintWorker.terminate();
       this._prettyPrintWorker = null;