Skip to content

fix: memory leak in accessible view toolbar - #333183

Merged
Connor Peet (connor4312) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-accessibleView-toolbar
Aug 31, 2026
Merged

Connor Peet (connor4312) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-accessibleView-toolbar

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

The accessible view registered a new toolbar menu in its lifetime store on every render, so closing Accessibility Help left the menu and its listeners reachable.

Change

Keep the toolbar menu in a replaceable disposable and clear it when the context view hides.

Before

When opening and closing Accessibility Help 37 times, six menu callbacks and menu objects grow by 37:

before

After

No more accessible view toolbar menu leak is detected.

Test Video

test-video.webm

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

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 the accessible-view toolbar menu leak by managing the active menu’s lifecycle explicitly.

Changes:

  • Replaces and disposes toolbar menus via MutableDisposable.
  • Clears the active menu when the context view hides.
  • Adds lifecycle coverage, though the hide-path regression remains untested.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
accessibleView.ts Manages and clears the active toolbar menu.
accessibleView.test.ts Tests menu replacement and view disposal.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@meganrogge Megan Rogge (meganrogge) left a comment

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.

Thank you!

@meganrogge

Copy link
Copy Markdown
Collaborator

Checks failing

@connor4312
Connor Peet (connor4312) merged commit fb6289d into microsoft:main Aug 31, 2026
27 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Aug 31, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-accessibleView-toolbar branch September 1, 2026 14:33
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
…accessibleView-toolbar

fix: memory leak in accessible view toolbar
(cherry picked from commit fb6289d)
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 15, 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.

5 participants