Skip to content

Commit 895e218

Browse files
committed
register disposables
1 parent edf9855 commit 895e218

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vs/workbench/contrib/terminal/browser/terminalSpeechToText.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class TerminalSpeechToTextSession extends Disposable {
3333
return TerminalSpeechToTextSession._instance;
3434
}
3535
private _cancellationTokenSource: CancellationTokenSource | undefined;
36-
private _disposables = new DisposableStore();
36+
private readonly _disposables: DisposableStore;
3737
constructor(
3838
@ISpeechService private readonly _speechService: ISpeechService,
3939
@ITerminalService readonly _terminalService: ITerminalService,
@@ -43,6 +43,7 @@ export class TerminalSpeechToTextSession extends Disposable {
4343
super();
4444
this._register(this._terminalService.onDidChangeActiveInstance(() => this.stop()));
4545
this._register(this._terminalService.onDidDisposeInstance(() => this.stop()));
46+
this._disposables = this._register(new DisposableStore());
4647
}
4748

4849
start(): void {
@@ -55,7 +56,7 @@ export class TerminalSpeechToTextSession extends Disposable {
5556
this._terminalService.activeInstance?.sendText(this._input, false);
5657
this.stop();
5758
}, voiceTimeout));
58-
this._cancellationTokenSource = new CancellationTokenSource();
59+
this._cancellationTokenSource = this._register(new CancellationTokenSource());
5960
const session = this._disposables.add(this._speechService.createSpeechToTextSession(this._cancellationTokenSource!.token));
6061

6162
this._disposables.add(session.onDidChange((e) => {

0 commit comments

Comments
 (0)