[vala] D-Bus: Use destroy_local instead of get_unref_expression
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] D-Bus: Use destroy_local instead of get_unref_expression
- Date: Wed, 4 May 2011 20:53:06 +0000 (UTC)
commit 0508be4065f11bb1a3135c0a384bf97abbb13b80
Author: Luca Bruno <lucabru src gnome org>
Date: Wed May 4 22:40:04 2011 +0200
D-Bus: Use destroy_local instead of get_unref_expression
codegen/valagdbusservermodule.vala | 36 +++++++-----------------------------
1 files changed, 7 insertions(+), 29 deletions(-)
---
diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala
index 75a2dc8..e2db9e4 100644
--- a/codegen/valagdbusservermodule.vala
+++ b/codegen/valagdbusservermodule.vala
@@ -314,14 +314,8 @@ public class Vala.GDBusServerModule : GDBusClientModule {
if (requires_destroy (m.return_type)) {
// keep local alive (symbol_reference is weak)
- // space before `result' is work around to not trigger
- // variable renaming, we really mean C identifier `result' here
- var local = new LocalVariable (m.return_type, " result");
- var ma = new MemberAccess.simple ("result");
- ma.symbol_reference = local;
- ma.value_type = local.variable_type.copy ();
- visit_member_access (ma);
- ccode.add_expression (get_unref_expression (new CCodeIdentifier ("result"), m.return_type, ma));
+ var local = new LocalVariable (m.return_type, ".result");
+ ccode.add_expression (destroy_local (local));
}
} else {
ccode.add_declaration (m.return_type.get_cname (), new CCodeVariableDeclarator ("result"));
@@ -339,14 +333,8 @@ public class Vala.GDBusServerModule : GDBusClientModule {
if (requires_destroy (m.return_type)) {
// keep local alive (symbol_reference is weak)
- // space before `result' is work around to not trigger
- // variable renaming, we really mean C identifier `result' here
- var local = new LocalVariable (m.return_type, " result");
- var ma = new MemberAccess.simple ("result");
- ma.symbol_reference = local;
- ma.value_type = local.variable_type.copy ();
- visit_member_access (ma);
- ccode.add_expression (get_unref_expression (new CCodeIdentifier ("result"), m.return_type, ma));
+ var local = new LocalVariable (m.return_type, ".result");
+ ccode.add_expression (destroy_local (local));
}
}
}
@@ -534,14 +522,8 @@ public class Vala.GDBusServerModule : GDBusClientModule {
if (requires_destroy (prop.get_accessor.value_type)) {
// keep local alive (symbol_reference is weak)
- // space before `result' is work around to not trigger
- // variable renaming, we really mean C identifier `result' here
- var local = new LocalVariable (prop.get_accessor.value_type, " result");
- var ma = new MemberAccess.simple ("result");
- ma.symbol_reference = local;
- ma.value_type = local.variable_type.copy ();
- visit_member_access (ma);
- ccode.add_expression (get_unref_expression (new CCodeIdentifier ("result"), prop.get_accessor.value_type, ma));
+ var local = new LocalVariable (prop.get_accessor.value_type, ".result");
+ ccode.add_expression (destroy_local (local));
}
ccode.add_return (new CCodeIdentifier ("_reply"));
@@ -596,11 +578,7 @@ public class Vala.GDBusServerModule : GDBusClientModule {
if (requires_destroy (owned_type)) {
// keep local alive (symbol_reference is weak)
var local = new LocalVariable (owned_type, "value");
- var ma = new MemberAccess.simple ("value");
- ma.symbol_reference = local;
- ma.value_type = local.variable_type.copy ();
- visit_member_access (ma);
- ccode.add_expression (get_unref_expression (new CCodeIdentifier ("value"), owned_type, ma));
+ ccode.add_expression (destroy_local (local));
}
pop_function ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]