Skip to content

[Bug] Editor throws error on dispose after upgrade from 0.51 to 0.52 #4702

@vadimpopa

Description

@vadimpopa

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Reproduction Steps

No response

Actual (Problematic) Behavior

After upgrading from 0.51 to 0.52 we get an error when editor.dispose() is called. I also noticed that when I remove the onDidChangeModelContent listener we don't get the error. It seems that there is some async in here because if I dispose editor in a timeout then I don't get the error as well.
I tried our code in playground, and we couldn't reproduce which is weird too, as we don't have anything uncommon.

We dispose everything as following:

	if (this.modelChangeDisposable) {
            this.modelChangeDisposable.dispose(); // what editorInstance.onDidChangeModelContent returns.
         }
         editor.getModel().dispose();
	editor.dispose();
Screenshot 2024-10-02 at 14 52 05

Expected Behavior

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions