Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispose of child instantiation services in MonacoEditor #15246

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Mar 21, 2025

What it does

Fixes #15242 by including a child instantiation service created as part of editor creation in the disposables for that editor.

How to test

  1. Put breakpoints on instantiation service creation / disposal, or modify the code in node_modules/@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiationService.js to provide logs.
  2. Open an editor.
  3. Four instantiation services should be created.
  4. Close the editor.
  5. Four instantiation services should be disposed of.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@JonasHelming JonasHelming requested a review from sdirix March 22, 2025 12:22
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debugged the instantiation as suggested. I can confirm that createChild is called 4 times per instantiation and was only disposed 2 times. With the PR I have the same number of instantiations and disposals. Good job!

@colin-grant-work colin-grant-work merged commit 2a2c0ba into master Mar 25, 2025
10 of 11 checks passed
@colin-grant-work colin-grant-work deleted the bugfix/dispose-of-child-instantiator branch March 25, 2025 14:02
@github-actions github-actions bot added this to the 1.60.0 milestone Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Memory leak when opening and closing editors
2 participants