]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix memory management with inferred generic type arguments
authorJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 21:26:11 +0000 (22:26 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 21:26:11 +0000 (22:26 +0100)
vala/valamethodcall.vala

index b9be421274de980cd81ee80815787e84961af5d8..01adb4f9ab9a044f2d1aa597a436d13f353632e2 100644 (file)
@@ -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;
                                                        }
                                                }