mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #4785 from Tyriar/4757
Fix possible exception when disposing terminal
This commit is contained in:
@@ -203,11 +203,14 @@ export class RenderService extends Disposable implements IRenderService {
|
||||
|
||||
public setRenderer(renderer: IRenderer): void {
|
||||
this._renderer.value = renderer;
|
||||
this._renderer.value.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));
|
||||
// If the value was not set, the terminal is being disposed so ignore it
|
||||
if (this._renderer.value) {
|
||||
this._renderer.value.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));
|
||||
|
||||
// Force a refresh
|
||||
this._needsSelectionRefresh = true;
|
||||
this._fullRefresh();
|
||||
// Force a refresh
|
||||
this._needsSelectionRefresh = true;
|
||||
this._fullRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
public addRefreshCallback(callback: FrameRequestCallback): number {
|
||||
|
||||
Reference in New Issue
Block a user