Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected ElementsMarshalling(IElementsMarshallingCollectionSource collectionSou
CollectionSource = collectionSource;
}

public StatementSyntax GenerateClearManagedSource(TypePositionInfo info, StubCodeContext context)
public StatementSyntax GenerateClearUnmanagedDestination(TypePositionInfo info, StubCodeContext context)
{
// <GetUnmanagedValuesDestination>.Clear();
return ExpressionStatement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public IEnumerable<StatementSyntax> GenerateMarshalStatements(TypePositionInfo i
{
// If the parameter is marshalled by-value [Out], then we don't marshal the contents of the collection.
// We do clear the span, so that if the invoke target doesn't fill it, we aren't left with undefined content.
yield return _elementsMarshalling.GenerateClearManagedSource(info, context);
yield return _elementsMarshalling.GenerateClearUnmanagedDestination(info, context);
yield break;
}
if (context.Direction == MarshalDirection.UnmanagedToManaged && !info.IsByRef && info.ByValueContentsMarshalKind.HasFlag(ByValueContentsMarshalKind.Out))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ public IEnumerable<StatementSyntax> GenerateMarshalStatements(TypePositionInfo i
{
// If the parameter is marshalled by-value [Out], then we don't marshal the contents of the collection.
// We do clear the span, so that if the invoke target doesn't fill it, we aren't left with undefined content.
yield return _elementsMarshalling.GenerateClearManagedSource(info, context);
yield return _elementsMarshalling.GenerateClearUnmanagedDestination(info, context);
yield break;
}

Expand Down