[vala/0.6] Free local variables in GObject constructors
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala/0.6] Free local variables in GObject constructors
- Date: Thu, 2 Apr 2009 09:11:58 -0400 (EDT)
commit 14adcb0d7b9678fbba93c4ae875606c291cc6761
Author: Jürg Billeter <j bitron ch>
Date: Wed Apr 1 22:08:31 2009 +0200
Free local variables in GObject constructors
Fixes bug 577641.
---
gobject/valaccodemethodmodule.vala | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/gobject/valaccodemethodmodule.vala b/gobject/valaccodemethodmodule.vala
index 5096111..fee4a4c 100644
--- a/gobject/valaccodemethodmodule.vala
+++ b/gobject/valaccodemethodmodule.vala
@@ -231,7 +231,15 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
cblock.add_statement (stmt.ccodenode);
}
}
-
+
+ foreach (LocalVariable local in m.body.get_local_variables ()) {
+ if (!local.floating && requires_destroy (local.variable_type)) {
+ var ma = new MemberAccess.simple (local.name);
+ ma.symbol_reference = local;
+ cblock.add_statement (new CCodeExpressionStatement (get_unref_expression (get_variable_cexpression (local.name), local.variable_type, ma)));
+ }
+ }
+
m.body.ccodenode = cblock;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]