Skip to content

fix: memory leak in references view - #330191

Merged
Dmitriy Vasyura (dmitrivMS) merged 13 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-reference
Aug 13, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 13 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-reference

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

EditorHighlights.dispose() cleared decorations from visible editors but left its TextEditorDecorationType registered, retaining the decoration rules and theme callback after the references view was disposed.

Change

Dispose the owned TextEditorDecorationType after clearing its decorations.

Before

When Find All References is run 37 times, the decoration rules and their callback state grow:

editor-references-before

After

No more matching references-view decoration leak is detected.

Test Video

editor-references.webm

Copilot AI balanced review requested due to automatic review settings August 11, 2026 08:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a references view memory leak by disposing its owned editor decoration type.

Changes:

  • Clears decorations from visible editors.
  • Disposes the decoration type and associated resources.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failures

auto-merge was automatically disabled August 13, 2026 12:12

Head branch was pushed to by a user without write access

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 3c95df8 into microsoft:main Aug 13, 2026
27 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 13, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-reference branch September 1, 2026 14:33
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants