From 6b5f2182587a8c3045db2f03ed9fd489a4d2f984 Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 29 May 2013 19:22:54 +0100 Subject: [PATCH] Use the previously declared local variable. --- src/Generator/Generators/CSharp/CSharpMarshal.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index e587627e..f9a1b812 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -200,8 +200,7 @@ namespace CppSharp.Generators.CSharp string instance = Context.ReturnVarName; if (ctx.Kind == CSharpMarshalKind.NativeField) { - instance = string.Format("new System.IntPtr(&{0})", - Context.ReturnVarName); + instance = string.Format("new System.IntPtr(&{0})", instance); } Context.Return.Write("new {0}({1})", QualifiedIdentifier(@class),