Use disposable registration

This commit is contained in:
Svante Boberg
2023-08-10 19:04:20 +02:00
parent adad53d526
commit 3b3012353f
@@ -136,7 +136,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
for (const l of this._renderLayers) {
l.dispose();
}
this._cursorBlinkStateManager?.dispose();
this._canvas.parentElement?.removeChild(this._canvas);
removeTerminalFromCache(this._terminal);
}));
@@ -366,9 +365,9 @@ export class WebglRenderer extends Disposable implements IRenderer {
private _updateCursorBlink(): void {
if (this._terminal.options.cursorBlink) {
if (!this._cursorBlinkStateManager) {
this._cursorBlinkStateManager = new CursorBlinkStateManager(() => {
this._cursorBlinkStateManager = this.register(new CursorBlinkStateManager(() => {
this._requestRedrawCursor();
}, this._coreBrowserService);
}, this._coreBrowserService));
}
} else {
this._cursorBlinkStateManager?.dispose();