Skip to content

race condition in terminal.dispose #5181

@jerch

Description

@jerch

image

Repro:

  • open demo in browser
  • call term.dispose()

The culprit seems to be the disposal of the webgl addon:

this._register(toDisposable(() => {
const renderService: IRenderService = (this._terminal as any)._core._renderService;
renderService.setRenderer((this._terminal as any)._core._createRenderer());
renderService.handleResize(terminal.cols, terminal.rows);
}));

Those lines recreate & attach a DOM renderer instance, which fails, if we are in the middle of terminal disposal. Imho it can be fixed by:

this._register(toDisposable(() => {
  if ((this._terminal as any)._core._store._isDisposed) {
    return;
  }
  const renderService: IRenderService = (this._terminal as any)._core._renderService;
  renderService.setRenderer((this._terminal as any)._core._createRenderer());
  renderService.handleResize(terminal.cols, terminal.rows);
}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething is misbehaving

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions