[vala] codegen: Use separate C statements for memory management
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Use separate C statements for memory management
- Date: Thu, 14 Oct 2010 12:59:56 +0000 (UTC)
commit c6bf7d99ec9ae543b4c60838aa0f1f3cb0a0475c
Author: Jürg Billeter <j bitron ch>
Date: Thu Oct 14 11:13:08 2010 +0200
codegen: Use separate C statements for memory management
codegen/valaccodebasemodule.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 005ac36..209aaa9 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -5095,7 +5095,11 @@ public class Vala.CCodeBaseModule : CodeGenerator {
if (node == null) {
node = expression_type;
}
- cexpr = get_ref_cexpression (target_type, cexpr, expr, node);
+
+ var decl = get_temp_variable (target_type, true, node, false);
+ emit_temp_var (decl);
+ ccode.add_expression (new CCodeAssignment (get_variable_cexpression (decl.name), get_ref_cexpression (target_type, cexpr, expr, node)));
+ cexpr = get_variable_cexpression (decl.name);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]