Skip to content

Better disposable leak fix#269613

Merged
lramos15 merged 1 commit intomainfrom
lramos15/latin-cow
Oct 2, 2025
Merged

Better disposable leak fix#269613
lramos15 merged 1 commit intomainfrom
lramos15/latin-cow

Conversation

@lramos15
Copy link
Copy Markdown
Member

@lramos15 lramos15 commented Oct 2, 2025

Better fix of #269498

Fixes #269498

Copilot AI review requested due to automatic review settings October 2, 2025 20:45
@lramos15 lramos15 enabled auto-merge (squash) October 2, 2025 20:45
@lramos15 lramos15 self-assigned this Oct 2, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves disposable resource management by ensuring proper cleanup in case of exceptions during language model provider registration. The fix addresses a potential resource leak where disposables could be left undisposed if an error occurs during the registration process.

Key changes:

  • Replaces automatic disposal management with explicit try-catch error handling
  • Ensures disposables are properly cleaned up when registration fails

Comment on lines +58 to +59
const disposables = new DisposableStore();
try {
Copy link

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

The disposables are no longer being added to this._store, which means they won't be automatically disposed when the MainThreadLanguageModels instance is disposed. Consider adding disposables to this._store after successful registration to ensure proper cleanup during instance disposal.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not true

@vs-code-engineering vs-code-engineering Bot added this to the September 2025 milestone Oct 2, 2025
@lramos15 lramos15 merged commit 9fd0d97 into main Oct 2, 2025
28 checks passed
@lramos15 lramos15 deleted the lramos15/latin-cow branch October 2, 2025 20:57
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 16, 2025
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.

[LEAKED DISPOSABLE] at MainThreadLanguageModels.$registerLanguageModelProvider

5 participants