Skip to content

Commit

Permalink
Merge pull request #4785 from Tyriar/4757
Browse files Browse the repository at this point in the history
Fix possible exception when disposing terminal
  • Loading branch information
Tyriar authored Sep 10, 2023
2 parents cfced0c + cc43fe5 commit a7eb112
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/browser/services/RenderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a7eb112

Please sign in to comment.