You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes: microsoft/CsWinRT#1321
Make ComWrappers in C# work closely with how C++ part works
- `RefCount` => `curr` is plain typo
- Do not destroy wrappers if ref count == 0. That's mimic how CoreCLR work
- Also discover 2 tests which are plainly wrong, since they do not work under CoreCLR
The reason will be displayed to describe this comment to others. Learn more.
After looking into this more, there's a more serious issue here that needs to be fixed before this is merged in. The ComWrappers implementation on NativeAOT uses a strong GC handle to hold the managed object alive from the MOW. With this change, the managed object will never be released, as the MOW will hold a strong ref to the managed object that will not be released until the MOW is destroyed, which won't happen until after the managed object is released since the MOW is kept alive by the managed object through a ConditionalWeakTable.
I believe we need to change the ComWrappers implementation to use ref-counted handles in this case. NativeAOT has partial support for ref-counted handles, but it might need to be extended slightly to work as well as possible.
ghost
locked as resolved and limited conversation to collaborators
Jul 1, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: microsoft/CsWinRT#1321 Make ComWrappers in C# work closely with how C++ part works
RefCount=>curris plain typo