Bug 1238939 - Fix reentrance loop with active requests during client close. r=jryans

This commit is contained in:
Alexandre Poirot 2016-01-26 03:23:47 -08:00
parent 29690bdd07
commit cea6561650

View File

@ -1100,12 +1100,14 @@ DebuggerClient.prototype = {
request.emit("json-reply", packet);
};
this._pendingRequests.forEach((list, actor) => {
let pendingRequests = new Map(this._pendingRequests);
this._pendingRequests.clear();
pendingRequests.forEach((list, actor) => {
list.forEach(request => reject("pending", request, actor));
});
this._pendingRequests.clear();
this._activeRequests.forEach(reject.bind(null, "active"));
let activeRequests = new Map(this._activeRequests);
this._activeRequests.clear();
activeRequests.forEach(reject.bind(null, "active"));
// The |_pools| array on the client-side currently is used only by
// protocol.js to store active fronts, mirroring the actor pools found in