Make sure we dispose of reader properly

This commit is contained in:
Matt Bierner 2018-11-14 14:15:31 -08:00
parent 6ef7e81ec0
commit d6b6c51b6e

View file

@ -178,7 +178,7 @@ export class TypeScriptServer extends Disposable {
private readonly _tracer: Tracer,
) {
super();
this._reader = new Reader<Proto.Response>(this._childProcess.stdout);
this._reader = this._register(new Reader<Proto.Response>(this._childProcess.stdout));
this._reader.onData(msg => this.dispatchMessage(msg));
this._childProcess.on('exit', code => this.handleExit(code));
this._childProcess.on('error', error => this.handleError(error));