Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@alexkozy
Copy link
Contributor

@alexkozy alexkozy commented Aug 2, 2025

dispose(IDisposable[]) call disposes every element of the array but does not clear the array itself - but it returns an empty array. As a result debugViewTitleItems array accumulates all items and keep references to them forever.

There are two potential solutions:

  • debugViewTitleItems = dispose(debugViewTitleItems)
  • use DisposableStore

This commit implements the second one.

@alexkozy
Copy link
Contributor Author

alexkozy commented Aug 2, 2025

cc @deepak1556

connor4312
connor4312 previously approved these changes Aug 4, 2025
Copy link
Member

@connor4312 connor4312 left a comment

Choose a reason for hiding this comment

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

thanks!

@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 4, 2025
DonJayamanne
DonJayamanne previously approved these changes Aug 4, 2025
@alexkozy alexkozy dismissed stale reviews from DonJayamanne and connor4312 via 9b10b67 August 4, 2025 05:27
@alexkozy
Copy link
Contributor Author

alexkozy commented Aug 4, 2025

@microsoft-github-policy-service agree company="Anysphere"

@alexkozy
Copy link
Contributor Author

alexkozy commented Aug 4, 2025

@connor4312 thanks for the review - i removed unused imports to address the hygiene concerns, so it looks like i need another approval.

`dispose(IDisposable[])` call disposes every element of the array but
does not clear the array itself - but it returns an empty array.
As a result `debugViewTitleItems` array accumulates all items and
keep references to them forever.

There are two potential solutions:
- `debugViewTitleItems = dispose(debugViewTitleItems)`
- use DisposableStore

This commit implements the second one.
@alexkozy alexkozy force-pushed the use-store-instead-of-array branch from 9b10b67 to 402a4fd Compare August 4, 2025 05:34
@bpasero bpasero enabled auto-merge (squash) August 4, 2025 19:46
// Debug toolbar

const debugViewTitleItems: IDisposable[] = [];
const debugViewTitleItems = new DisposableStore();
Copy link
Member

Choose a reason for hiding this comment

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

Small nit: this should be marked as singleton as well because it never gets disposed.

@bpasero bpasero merged commit 84b0f1c into microsoft:main Aug 4, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 18, 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.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.