Bug 1268073 - Prevent leaking BrowserToolboxProcess instance when debuggerServer leaks. r=jryans

This commit is contained in:
Alexandre Poirot 2016-06-28 08:39:36 -07:00
Родитель 8355107fb5
Коммит b62081ba39
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -132,7 +132,7 @@ BrowserToolboxProcess.prototype = {
dumpn("Created a separate loader instance for the DebuggerServer.");
// Forward interesting events.
this.debuggerServer.on("connectionchange", this.emit.bind(this));
this.debuggerServer.on("connectionchange", this.emit);
this.debuggerServer.init();
this.debuggerServer.addBrowserActors();
@ -249,6 +249,7 @@ BrowserToolboxProcess.prototype = {
this._telemetry.toolClosed("jsbrowserdebugger");
if (this.debuggerServer) {
this.debuggerServer.off("connectionchange", this.emit);
this.debuggerServer.destroy();
this.debuggerServer = null;
}