Fix crash when marshalling generated managed interfaces

Marshaller returns a permanent handle, avoid releasing it during marshalling
This commit is contained in:
2023-01-16 20:11:14 +02:00
parent 1a1fadcc2f
commit be720257ca

View File

@@ -1932,7 +1932,6 @@ namespace Flax.Build.Bindings
contents.AppendLine("#pragma warning disable 1591");
contents.Append(indent).Append(" ").AppendLine($"internal static {interfaceInfo.Name} ConvertToManaged(IntPtr unmanaged) => ({interfaceInfo.Name})ManagedHandleMarshaller.ConvertToManaged(unmanaged);");
contents.Append(indent).Append(" ").AppendLine($"internal static IntPtr ConvertToUnmanaged({interfaceInfo.Name} managed) => ManagedHandleMarshaller.ConvertToUnmanaged(managed);");
contents.Append(indent).Append(" ").AppendLine("internal static void Free(IntPtr unmanaged) => ManagedHandleMarshaller.Free(unmanaged);");
contents.AppendLine("#pragma warning restore 1591");
contents.Append(indent).AppendLine("}");
}