Skip to content

ConditionalWeakTable does not release values if values reference the ConditionalWeaktable itself #3273

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

Open
pjanotti opened this issue Aug 10, 2018 · 3 comments
Labels
area-System.Runtime.CompilerServices doc-enhancement Improve the current content Pri3 Indicates issues/PRs that are low priority
Milestone

Comments

@pjanotti
Copy link
Contributor

This is a special case described at https://github.com/dotnet/corefx/issues/19765. The issue is if one of the values added to the ConditionalWeakTable references the table itself then one must call Clear (or use one of the other workarounds described on the issue) to ensure that there are no leaks.

This is not mentioned explicit on the docs but seems a special case that should be documented to save users from memory leaks.

@mairaw
Copy link
Contributor

mairaw commented Aug 13, 2018

@pjanotti would you like to help us with a PR for this?

@pjanotti
Copy link
Contributor Author

I can get it started. Should it be a note on the remarks section at https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.conditionalweaktable-2?view=netcore-2.1 ?

@mairaw
Copy link
Contributor

mairaw commented Aug 17, 2018

If you'd like it to stand out, then yes! Otherwise, just regular text on the Remarks section @pjanotti. Thanks!

@mairaw mairaw transferred this issue from dotnet/docs Oct 1, 2019
@dotnet-bot dotnet-bot added the untriaged New issue has not been triaged by the area owner label Oct 1, 2019
@mairaw mairaw added this to the Backlog milestone Oct 1, 2019
@mairaw mairaw added doc-enhancement Improve the current content and removed untriaged New issue has not been triaged by the area owner labels Oct 1, 2019
@PRMerger13 PRMerger13 added the Pri3 Indicates issues/PRs that are low priority label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime.CompilerServices doc-enhancement Improve the current content Pri3 Indicates issues/PRs that are low priority
Projects
None yet
Development

No branches or pull requests

5 participants