[vala] Fix memory management with inferred generic type arguments



commit 233eabb9c52c6ae2bcd78b30a5178a5836134ea8
Author: Jürg Billeter <j bitron ch>
Date:   Sat Mar 20 22:26:11 2010 +0100

    Fix memory management with inferred generic type arguments

 vala/valamethodcall.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index b9be421..01adb4f 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;
 							}
 						}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]