diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index 24406c14..aaa450da 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -494,7 +494,8 @@ namespace CppSharp.Generators.CSharp if (!VisitType(pointer, quals)) return false; - if (Context.Function != null && pointer.IsPrimitiveTypeConvertibleToRef()) + if (Context.Function != null && pointer.IsPrimitiveTypeConvertibleToRef() && + Context.Kind != CSharpMarshalKind.VTableReturnValue) { var refParamPtr = string.Format("__refParamPtr{0}", Context.ParameterIndex); Context.SupportBefore.WriteLine("fixed ({0} {1} = &{2})", diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 1608eaca..5e8f4a04 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -36,7 +36,7 @@ public: class NestedAbstract { public: - virtual void abstractFunctionInNestedClass() = 0; + virtual int* abstractFunctionInNestedClass() = 0; }; Foo();