Dispose of proxy listeners properly

This commit is contained in:
Daniel Imms
2018-04-19 11:08:31 -07:00
parent b7985f4157
commit 8bff395525
3 changed files with 22 additions and 14 deletions

View File

@@ -109,10 +109,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
env: request.shellLaunchConfig.env
};
this._proxy.$createProcess(request.proxy.terminalId, shellLaunchConfigDto, request.cols, request.rows);
// TODO: Dispose of this properly when the terminal/process dies
this._toDispose.push(request.proxy.onInput(data => this._proxy.$acceptProcessInput(request.proxy.terminalId, data)));
this._toDispose.push(request.proxy.onResize((cols, rows) => this._proxy.$acceptProcessResize(request.proxy.terminalId, cols, rows)));
this._toDispose.push(request.proxy.onShutdown(() => this._proxy.$acceptProcessShutdown(request.proxy.terminalId)));
request.proxy.onInput(data => this._proxy.$acceptProcessInput(request.proxy.terminalId, data));
request.proxy.onResize((cols, rows) => this._proxy.$acceptProcessResize(request.proxy.terminalId, cols, rows));
request.proxy.onShutdown(() => this._proxy.$acceptProcessShutdown(request.proxy.terminalId));
}
public $sendProcessTitle(terminalId: number, title: string): void {