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

[release/6.0] Don't create a COM weak reference if the object is an aggregated COMWrappers RCW. #61283

Merged
merged 3 commits into from
Nov 9, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 6, 2021

Backport of #61267 to release/6.0

/cc @jkoritzinsky

Customer Impact

The issue blocks users from using the WeakReference and WeakReference<T> with managed types that inherit from WinRT native types and that implement IWeakReferenceSource. This means that managed developers extending common WinRT types are likely blocked from creating managed weak references.

Testing

New testing was added in this PR. The original issue was reproducible and with this change we've confirmed it is fixed. The mitigate is to follow the same behavior as from .NET Framework's support of WinRT—don't query for IWeakReferenceSource if the managed type is aggregated.

Risk

Low. Although this does touch that code may be run in with managed WeakReference and WeakReference<T> it is narrowly defined to only trigger when WinRT types are involved. This only impacts C#/WinRT and WinUI scenarios.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. Please fill out the template and investigate the failing CI, we can then take for consideration in .NET 6.0.x

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 9, 2021
@leecow leecow modified the milestones: 6.0.x, 6.0.1 Nov 9, 2021
@Anipik Anipik merged commit 9c60882 into release/6.0 Nov 9, 2021
@jkoritzinsky jkoritzinsky deleted the backport/pr-61267-to-release/6.0 branch November 9, 2021 19:14
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants