Skip to content

fix: memory leak in explorer viewer - #332332

Merged
Dmitriy Vasyura (dmitrivMS) merged 8 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-explorer-viewer
Aug 24, 2026
Merged

fix: memory leak in explorer viewer#332332
Dmitriy Vasyura (dmitrivMS) merged 8 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-explorer-viewer

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

FileDragAndDrop registers an explorer.enableDragAndDrop configuration listener in its DisposableStore. When Explorer is moved to the panel, the old viewer is disposed but that store stays live, so updateDropEnablement and the retired Explorer viewer tree remain reachable.

Change

Dispose the FileDragAndDrop store together with its other drag-and-drop resources.

Before

When moving Explorer to the panel 17 times, updateDropEnablement grows by 17 and retains the associated Explorer viewer callbacks:

before

After

No more explorer viewer leak is detected.

Test Video

test-video.webm

Copilot AI balanced review requested due to automatic review settings August 24, 2026 14:14

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 an Explorer viewer memory leak by releasing the drag-and-drop configuration listener when its tree is disposed.

Changes:

  • Disposes FileDragAndDrop’s DisposableStore during teardown.

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

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 6bf2e7a into microsoft:main Aug 24, 2026
27 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 24, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-explorer-viewer branch September 1, 2026 14:33
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