Skip to content
Merged
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
10 changes: 8 additions & 2 deletions sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2805,9 +2805,11 @@ private string GetCursorName(NamedDecl namedDecl)
Debug.Assert(parent is not null);
name = GetCursorName(parent);
}
else if (namedDecl is CXXDestructorDecl)
else if (namedDecl is CXXDestructorDecl cxxDestructorDecl)
{
name = "Dispose";
var parent = cxxDestructorDecl.Parent;
Debug.Assert(parent is not null);
name = $"~{GetCursorName(parent)}";
}
else if (string.IsNullOrWhiteSpace(name) || name.StartsWith('('))
{
Expand Down Expand Up @@ -3160,6 +3162,10 @@ private string GetRemappedCursorName(NamedDecl namedDecl, out string nativeTypeN
Debug.Assert(parent is not null);
remappedName = GetRemappedCursorName(parent);
}
else if (namedDecl is CXXDestructorDecl)
{
remappedName = "Dispose";
}
else if (namedDecl is FieldDecl fieldDecl)
{
if (name.StartsWith("__AnonymousFieldDecl_", StringComparison.Ordinal))
Expand Down
Loading