mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877719 - DebuggerServer.destroy should always work. r=past
This commit is contained in:
parent
1d11d0dc32
commit
5625626545
@ -150,15 +150,20 @@ var DebuggerServer = {
|
||||
* method returns, the debugger server must be initialized again before use.
|
||||
*/
|
||||
destroy: function DS_destroy() {
|
||||
if (Object.keys(this._connections).length == 0) {
|
||||
this.closeListener();
|
||||
this.globalActorFactories = {};
|
||||
this.tabActorFactories = {};
|
||||
delete this._allowConnection;
|
||||
this._transportInitialized = false;
|
||||
this._initialized = false;
|
||||
dumpn("Debugger server is shut down.");
|
||||
if (!this._initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let connID of Object.getOwnPropertyNames(this._connections)) {
|
||||
this._connections[connID].close();
|
||||
}
|
||||
this.closeListener();
|
||||
this.globalActorFactories = {};
|
||||
this.tabActorFactories = {};
|
||||
delete this._allowConnection;
|
||||
this._transportInitialized = false;
|
||||
this._initialized = false;
|
||||
dumpn("Debugger server is shut down.");
|
||||
},
|
||||
|
||||
/**
|
||||
@ -525,6 +530,10 @@ DebuggerServerConnection.prototype = {
|
||||
_transport: null,
|
||||
get transport() { return this._transport },
|
||||
|
||||
close: function() {
|
||||
this._transport.close();
|
||||
},
|
||||
|
||||
send: function DSC_send(aPacket) {
|
||||
this.transport.send(aPacket);
|
||||
},
|
||||
|
@ -173,7 +173,10 @@ DebuggerTransport.prototype = {
|
||||
onStopRequest:
|
||||
makeInfallible(function DT_onStopRequest(aRequest, aContext, aStatus) {
|
||||
this.close();
|
||||
this.hooks.onClosed(aStatus);
|
||||
if (this.hooks) {
|
||||
this.hooks.onClosed(aStatus);
|
||||
this.hooks = null;
|
||||
}
|
||||
}, "DebuggerTransport.prototype.onStopRequest"),
|
||||
|
||||
onDataAvailable:
|
||||
@ -292,7 +295,10 @@ LocalDebuggerTransport.prototype = {
|
||||
delete this.other;
|
||||
other.close();
|
||||
}
|
||||
this.hooks.onClosed();
|
||||
if (this.hooks) {
|
||||
this.hooks.onClosed();
|
||||
this.hooks = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user