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

Only call Free in unmanaged->managed stubs when ownership has been transfered to the callee #86415

Merged
merged 9 commits into from
May 23, 2023

Conversation

jkoritzinsky
Copy link
Member

Fixes #85795

@jkoritzinsky jkoritzinsky added area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature labels May 17, 2023
@jkoritzinsky jkoritzinsky added this to the 8.0.0 milestone May 17, 2023
@ghost ghost assigned jkoritzinsky May 17, 2023
@ghost
Copy link

ghost commented May 17, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #85795

Author: jkoritzinsky
Assignees: -
Labels:

area-System.Runtime.InteropServices, source-generator

Milestone: 8.0.0

…sable by-value [In,Out] on unmanged->managed for now as it's difficult to reason about.
…o-managed. It still needs additional work to function, but this at least fixes the compilation problems, enabling usage in managed->unmanaged COM scenarios.
… the expectation (always free stateful marshaller state, only free elements when we're supposed to).
@jkoritzinsky
Copy link
Member Author

I've updated this PR to correctly handle lifetimes for collection marshallers (stateless and stateful). I've opened #86608 to track additional work to complete this story.

Copy link
Member

@jtschuster jtschuster left a comment

Choose a reason for hiding this comment

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

LGTM

@jkoritzinsky
Copy link
Member Author

All failures are known

@jkoritzinsky jkoritzinsky merged commit b87a698 into dotnet:main May 23, 2023
@jkoritzinsky jkoritzinsky deleted the fix-stateless-free branch May 23, 2023 18:13
@ghost ghost locked as resolved and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices source-generator Indicates an issue with a source generator feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ComInterfaceGenerator generates cleanup stage for stateless marshalled parameters when it shouldn't
4 participants