diff --git a/devtools/server/devtools-server-connection.js b/devtools/server/devtools-server-connection.js index 098e5405d0cf..1c88071ab6dc 100644 --- a/devtools/server/devtools-server-connection.js +++ b/devtools/server/devtools-server-connection.js @@ -123,11 +123,8 @@ DevToolsServerConnection.prototype = { * * @param ActorPool actorPool * The ActorPool instance you want to remove. - * @param boolean noCleanup [optional] - * True if you don't want to destroy each actor from the pool, false - * otherwise. */ - removeActorPool(actorPool, noCleanup) { + removeActorPool(actorPool) { // When a connection is closed, it removes each of its actor pools. When an // actor pool is removed, it calls the destroy method on each of its // actors. Some actors, such as ThreadActor, manage their own actor pools. @@ -150,10 +147,7 @@ DevToolsServerConnection.prototype = { } const index = this._extraPools.lastIndexOf(actorPool); if (index > -1) { - const pool = this._extraPools.splice(index, 1); - if (!noCleanup) { - pool.forEach(p => p.destroy()); - } + this._extraPools.splice(index, 1); } }, diff --git a/devtools/shared/protocol/Pool.js b/devtools/shared/protocol/Pool.js index 4c5ba9616df1..94a071defa76 100644 --- a/devtools/shared/protocol/Pool.js +++ b/devtools/shared/protocol/Pool.js @@ -190,7 +190,7 @@ class Pool extends EventEmitter { actor.destroy = destroy; } } - this.conn.removeActorPool(this, true); + this.conn.removeActorPool(this); this.__poolMap.clear(); this.__poolMap = null; }