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

Don't create a COM weak reference if the object is an aggregated COMWrappers RCW. #61267

Merged
merged 3 commits into from
Nov 6, 2021

Conversation

jkoritzinsky
Copy link
Member

@jkoritzinsky jkoritzinsky commented Nov 5, 2021

This prevents us from trying to re-create a managed object that is a user-defined object deriving from an RCW type from a COM IWeakReference (which fails).

The included test crashes on main with an AV and passes with the changes in this PR.

Fixes microsoft/CsWinRT#1025

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
@AaronRobinsonMSFT
Copy link
Member

@jkoritzinsky Let's start the port to .NET 6 ASAP.

@jkoritzinsky
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2021

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1429642390

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Taking a WeakReference to a C# object that inherits a native WinRT object crashes the app.
2 participants