Skip to content

Conversation

@SimonSiefke
Copy link
Contributor

Fixes a few possible memory leaks with decoration registration by registering the returned disposable.

Details

Currently decorations are registered like this:

this.codeEditorService.registerDecorationType(decorationDescription, placeholderDecorationType, {});

But it can be easy to forget that most likely the decoration also needs to be removed on dispose:

this.codeEditorService.removeDecorationType(placeholderDecorationType);

Change

The change is to switch to using this._register, which seems to make it easier to register the decoration as a disposable. Now for example in commentsController or breakPointWidget the decoration registration is registered as a disposable.

@hediet
Copy link
Member

hediet commented Nov 24, 2025

Thank you!

@hediet hediet added this to the November 2025 milestone Nov 24, 2025
@hediet hediet enabled auto-merge (squash) November 24, 2025 16:50
@hediet hediet merged commit ea1c221 into microsoft:main Nov 24, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants