diff --git a/generator/Parameter.cs b/generator/Parameter.cs index 7c6016b50..a77db28fc 100644 --- a/generator/Parameter.cs +++ b/generator/Parameter.cs @@ -408,9 +408,12 @@ namespace GtkSharp.Generation { public override string[] Finish { get { - string[] result = new string [2]; - result [0] = CallName + " = " + FromNative ("native_" + CallName) + ";"; - result [1] = (Generatable as IManualMarshaler).ReleaseNative ("native_" + CallName) + ";"; + string[] result = new string [PassAs == string.Empty ? 1 : 2]; + int i = 0; + if (PassAs != string.Empty) { + result [i++] = CallName + " = " + FromNative ("native_" + CallName) + ";"; + } + result [i++] = (Generatable as IManualMarshaler).ReleaseNative ("native_" + CallName) + ";"; return result; } }