Only dispose TerminalInstance.onExit when it's already disposed

Fixes #130277
This commit is contained in:
Daniel Imms 2021-08-11 05:47:47 -07:00
parent 227601428b
commit 2e23a7c3ad

View file

@ -1332,8 +1332,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
}
}
// First onExit to consumers, this can happen after the terminal has already been disposed.
this._onExit.fire(this._exitCode);
this._onExit.dispose();
// Dispose of the onExit event if the terminal will not be reused again
if (this._isDisposed) {
this._onExit.dispose();
}
}
/**