From: Jürg Billeter Date: Sat, 20 Mar 2010 21:26:11 +0000 (+0100) Subject: Fix memory management with inferred generic type arguments X-Git-Tag: 0.8.0~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=233eabb9c52c6ae2bcd78b30a5178a5836134ea8;p=thirdparty%2Fvala.git Fix memory management with inferred generic type arguments --- diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index b9be42127..01adb4f9a 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -570,7 +570,8 @@ public class Vala.MethodCall : Expression { var generic_type = param.parameter_type as GenericType; if (generic_type != null && generic_type.type_parameter == type_param) { - type_arg = arg.value_type; + type_arg = arg.value_type.copy (); + type_arg.value_owned = true; break; } @@ -582,7 +583,8 @@ public class Vala.MethodCall : Expression { if (type_arg == null) { var generic_type = m.return_type as GenericType; if (generic_type != null && generic_type.type_parameter == type_param) { - type_arg = target_type; + type_arg = target_type.copy (); + type_arg.value_owned = true; } }