diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index 7bae725b..f7b37e3d 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -236,15 +236,6 @@ namespace CppSharp.Generators.CSharp var ctx = Context as CSharpMarshalContext; string instance = Context.ReturnVarName; - if (ctx.Kind == CSharpMarshalKind.NativeField) - { - string copy = Generator.GeneratedIdentifier("copy"); - if (VarSuffix > 0) - copy += VarSuffix; - Context.SupportBefore.WriteLine( - "var {0} = new global::System.IntPtr(&{1});", copy, instance); - instance = copy; - } if (@class.IsRefType && (Context.ReturnType.Qualifiers.IsConst || !Context.ReturnType.Type.IsAddress()) &&