Repository navigation
fix: memory leak in multi diff editor tabs - #333186
Merged
Dmitriy Vasyura (dmitrivMS) merged 5 commits intoSep 29, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 5 commits into
Dmitriy Vasyura (dmitrivMS) merged 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a retained multi-diff resource listener when editor tabs close.
Changes:
- Disposes listeners using the original
EditorInput. - Adds regression assertions for listener cleanup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
mainThreadEditorTabs.ts |
Corrects listener disposal on tab closure. |
mainThreadEditorTabs.test.ts |
Verifies listener-map cleanup. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
Keep private listener-map access type-checked through one scoped test-only lint exception, preserving the lifecycle regression assertions. Refs microsoft#333186. Co-authored-by: Copilot <[email protected]>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 29, 2026
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Anthony Kim (anthonykim1)
approved these changes
Sep 29, 2026
Dmitriy Vasyura (dmitrivMS)
merged commit Sep 29, 2026
8636777
into
microsoft:main
54 of 56 checks passed
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-editorTabs-multiDiff
branch
September 29, 2026 11:15
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.
Fixes #228367
Details
Opening and closing the Source Control multi-diff editor 37 times retained 37
MultiDiffEditorInputinstances, 37 view models and SCM sources, and 111 diff items. The shortest retaining path ended atMainThreadEditorTabs._multiDiffEditorInputListeners.Change
Dispose the multi-diff resource listener using the original editor input stored in
TabInfowhen the tab closes. Add a browser regression assertion that the listener map returns to zero after the open/close event sequence.Before
The multi-diff input graph grew once per iteration. The highlighted rows are fixed by this change; the unrelated
DomListenerrow is intentionally excluded.After
The multi-diff inputs, sources, view models, items, and tab listener callbacks no longer grow. A separate
DomListenerrow remains at the unchanged baseline delta of 69 and is outside this focused fix.Test Video
test-video.webm