Skip to content

Conversation

@mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Sep 24, 2025

For #267785

This pattern is not safe when working with an IDisposable

For microsoft#267785

This pattern is not safe when working with an `IDisposable`
Copilot AI review requested due to automatic review settings September 24, 2025 17:37
Copy link
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 fixes a potential issue with unbound method references when disposing of chat agents. The change ensures proper context binding when calling the dispose method on disposable objects.

  • Wraps the dispose method call in an arrow function to maintain proper this context

@vs-code-engineering
Copy link

⚠️ This PR originates from a fork. Due to security restrictions, pipelines from forks are no longer triggered automatically. Learn more.

If the changes appear safe, you can manually trigger the pipeline by commenting /AzurePipelines run.

@mjbvz mjbvz changed the title Don't use unbound this for dispose Don't use unbound this for dispose Sep 24, 2025
@mjbvz mjbvz enabled auto-merge September 24, 2025 17:41
mjbvz added a commit to mjbvz/vscode that referenced this pull request Sep 24, 2025
Found while fixing microsoft#268202

Will see if we want to add an eslint rule for this too
@mjbvz mjbvz merged commit 4a17b38 into microsoft:main Sep 24, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 8, 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.

2 participants