Repository navigation
fix: memory leak in canceled tree drag transfers - #340845
Merged
Alex Ross (alexr00) merged 3 commits intoOct 13, 2026
Merged
Alex Ross (alexr00) merged 3 commits into
Alex Ross (alexr00) merged 3 commits into
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new cleanup is not connected to actual tree/controller disposal, leaving the teardown leak unresolved.
1 open finding
What changed in this PR
Fixes leaked tree drag-transfer records after canceled or replaced drags.
Changes:
- Tracks and retires active drag operations across renderer and extension host.
- Adds an RPC for releasing extension-host transfers.
- Adds cancellation, disposal, replacement, and successful-drop tests.
| File | Description |
|---|---|
src/vs/workbench/test/browser/customTreeViewDragAndDrop.test.ts |
Tests renderer drag lifecycle cleanup. |
src/vs/workbench/common/views.ts |
Adds the drag-release callback. |
src/vs/workbench/browser/parts/views/treeView.ts |
Tracks and cancels active operations. |
src/vs/workbench/api/test/browser/mainThreadTreeViews.test.ts |
Tests release forwarding. |
src/vs/workbench/api/test/browser/extHostTreeViews.test.ts |
Tests extension-host transfer cleanup. |
src/vs/workbench/api/common/extHostTreeViews.ts |
Removes canceled or failed transfers. |
src/vs/workbench/api/common/extHost.protocol.ts |
Defines the release RPC. |
src/vs/workbench/api/browser/mainThreadTreeViews.ts |
Forwards releases to the extension host. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Alex Ross (alexr00)
approved these changes
Oct 12, 2026
Alex Ross (alexr00)
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR!
Alex Ross (alexr00)
enabled auto-merge (squash)
October 12, 2026 14:01
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Oct 12, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 13, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-canceledTreeDragTransfers
branch
October 13, 2026 09:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Details
Canceling a tree drag leaves its completed transfer promise in both the renderer and extension-host drag-transfer maps. A completed provider request can therefore outlive the drag that owned it.
Change
Retire the exact drag operation on cancellation, replacement, or controller teardown. Clear its local transfer and notify the original extension-host controller to release the matching transfer.
Before
When canceling tree drags for 37 cycles, completed transfer records grow from 0 to 37 in both processes. The complete extension-host named-function chart shows the three callback rows for that transfer.
After
No more leak detected.
Test Video
test-video.webm
AI disclosure: Model: GPT-6.1-Sol. Worktime: 23 min