mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 865328: Close console clients by building a chain of continuations. r=msucan
This commit is contained in:
parent
1ee74732c4
commit
b8c5e96efb
@ -350,26 +350,17 @@ DebuggerClient.prototype = {
|
||||
|
||||
let self = this;
|
||||
|
||||
let consolesClosed = 0;
|
||||
let consolesToClose = 0;
|
||||
|
||||
for each (let client in this._consoleClients) {
|
||||
consolesToClose++;
|
||||
client.close(onConsoleClose);
|
||||
}
|
||||
|
||||
if (!consolesToClose) {
|
||||
detachThread();
|
||||
}
|
||||
|
||||
function onConsoleClose() {
|
||||
consolesClosed++;
|
||||
if (consolesClosed >= consolesToClose) {
|
||||
let continuation = function () {
|
||||
self._consoleClients = {};
|
||||
detachThread();
|
||||
}
|
||||
|
||||
for each (let client in this._consoleClients) {
|
||||
continuation = client.close.bind(client, continuation);
|
||||
}
|
||||
|
||||
continuation();
|
||||
|
||||
function detachThread() {
|
||||
if (self.activeThread) {
|
||||
self.activeThread.detach(detachTab);
|
||||
|
Loading…
Reference in New Issue
Block a user