Skip to content

ComInterfaceGenerator generates cleanup stage for stateless marshalled parameters when it shouldn't #85795

@jtschuster

Description

@jtschuster

Parameters marshalled by stateless marshallers are being freed in too many scenarios. They should only be freed in unmanaged to managed ref scenarios (on the pointer that was passed in, not the value that is returned at the end of the method. In and Out parameters should not be cleaned up. Stateful marshallers can have free called on them as they can know which MarshalMode they are in and decide to actually free the underlying memory or not.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions