[vala] codegen: Fix memory management in generic methods



commit ed975b0f9b1043f4bdfb2ee39cd9ae1e5cdf7313
Author: Jürg Billeter <j bitron ch>
Date:   Fri May 20 21:17:50 2011 +0200

    codegen: Fix memory management in generic methods
    
    Fixes bug 648903.

 codegen/valaccodebasemodule.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 55ecb69..87818a1 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2690,7 +2690,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 				return new CCodeConstant ("NULL");
 			}
 			return new CCodeIdentifier (unref_function);
-		} else if (type.type_parameter != null && current_type_symbol is Class) {
+		} else if (type.type_parameter != null) {
 			string func_name = "%s_destroy_func".printf (type.type_parameter.name.down ());
 			if (is_in_generic_type (type) && !is_chainup && !in_creation_method) {
 				return new CCodeMemberAccess.pointer (new CCodeMemberAccess.pointer (get_result_cexpression ("self"), "priv"), func_name);



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