[vala] codegen: Free locals before executing finally block



commit a0648afbd890210c677e0664df4bcc559399037f
Author: Jürg Billeter <j bitron ch>
Date:   Wed Apr 27 12:48:18 2011 +0200

    codegen: Free locals before executing finally block
    
    Inner variables should be freed before outer variables.

 codegen/valagerrormodule.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala
index 0918a20..70d335d 100644
--- a/codegen/valagerrormodule.vala
+++ b/codegen/valagerrormodule.vala
@@ -373,6 +373,8 @@ public class Vala.GErrorModule : CCodeDelegateModule {
 	}
 
 	public override void append_local_free (Symbol sym, bool stop_at_loop = false, CodeNode? stop_at = null) {
+		base.append_local_free (sym, stop_at_loop, stop_at);
+
 		if (!(stop_at is TryStatement || stop_at is CatchClause)) {
 			var finally_block = (Block) null;
 			if (sym.parent_node is TryStatement) {
@@ -385,8 +387,6 @@ public class Vala.GErrorModule : CCodeDelegateModule {
 				finally_block.emit (this);
 			}
 		}
-
-		base.append_local_free (sym, stop_at_loop, stop_at);
 	}
 }
 



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