Skip to content

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

Merged
Anipik merged 3 commits into
release/6.0from
backport/pr-61267-to-release/6.0
Nov 9, 2021
Merged

[release/6.0] Don't create a COM weak reference if the object is an aggregated COMWrappers RCW.#61283
Anipik merged 3 commits into
release/6.0from
backport/pr-61267-to-release/6.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Nov 6, 2021

Copy link
Copy Markdown
Contributor

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.

@AaronRobinsonMSFTAaronRobinsonMSFT added this to the 6.0.x milestone Nov 6, 2021
@AaronRobinsonMSFTAaronRobinsonMSFT added the Servicing-consider Issue for next servicing release review label Nov 6, 2021

@jeffschwMSFTjeffschwMSFT left a comment

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.

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

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

Labels

area-Interop-coreclrServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@jeffschwMSFT@leecow@Anipik@AaronRobinsonMSFT@jkoritzinsky