Repository navigation
fix: memory leak in mainThreadNotebook - #334189
Merged
Megan Rogge (meganrogge) merged 1 commit intoSep 3, 2026
Merged
Megan Rogge (meganrogge) merged 1 commit into
Megan Rogge (meganrogge) merged 1 commit into
Conversation
Copilot started reviewing on behalf of
Simon Siefke (SimonSiefke)
September 3, 2026 07:09
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused cleanup correctly addresses the leak and includes appropriate regression coverage.
Pull request overview
Fixes notebook cell status bar provider leaks after extension host restarts.
Changes:
- Disposes and clears status bar provider registrations.
- Adds regression coverage for cleanup behavior.
File summaries
| File | Description |
|---|---|
mainThreadNotebook.ts |
Cleans up provider registrations on disposal. |
mainThreadNotebook.test.ts |
Verifies registrations are disposed and removed. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Megan Rogge (meganrogge)
approved these changes
Sep 3, 2026
Ladislau Szomoru (lszomoru)
approved these changes
Sep 3, 2026
Megan Rogge (meganrogge)
enabled auto-merge (squash)
September 3, 2026 15:32
Ladislau Szomoru (lszomoru)
approved these changes
Sep 3, 2026
roblourens
approved these changes
Sep 3, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-mainThreadNotebook
branch
September 20, 2026 07:39
Abdon Morales (abdonmorales)
pushed a commit
to abdonmorales/vscode-utcs
that referenced
this pull request
Sep 23, 2026
fix: dispose notebook cell status bar registrations (cherry picked from commit c24222b)
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
Notebook cell status bar providers are registered in the shared
NotebookCellStatusBarService. When the extension host restarts,MainThreadNotebooksdid not dispose those registrations, so each restart left a provider connected to the old main-thread customer.Change
Dispose every cell status bar provider registration and clear the registration map when
MainThreadNotebooksis disposed.Before
When an extension with a notebook cell status bar provider is active and the extension host is restarted 37 times, the provider callback and its old main-thread customer grow once per restart:
After
No more matching leak is detected.
Test Video
restart-extension-host-7-runs.webm