[vala] codegen: Use destroy_value in emit_simple_assignment



commit 2f011528de07de32fbbdbfe82a187c8ac0706c2c
Author: Luca Bruno <lucabru src gnome org>
Date:   Wed May 4 22:43:16 2011 +0200

    codegen: Use destroy_value in emit_simple_assignment

 codegen/valaccodeassignmentmodule.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodeassignmentmodule.vala b/codegen/valaccodeassignmentmodule.vala
index 43b9dba..9ff0635 100644
--- a/codegen/valaccodeassignmentmodule.vala
+++ b/codegen/valaccodeassignmentmodule.vala
@@ -62,7 +62,9 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
 			ccode.add_assignment (get_variable_cexpression (temp_decl.name), rhs);
 			if (unref_old) {
 				/* unref old value */
-				ccode.add_expression (get_unref_expression (lhs, assignment.left.value_type, assignment.left));
+				var value = ((GLibValue) assignment.left.target_value).copy ();
+				value.cvalue = lhs;
+				ccode.add_expression (destroy_value (value));
 			}
 			
 			if (array && !variable.no_array_length && !variable.array_null_terminated) {



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