[vala] codegen: Fix missing _inner_error_ declaration in destructors



commit f6f4f15ff305c54bccb6fcda04a942904fd66267
Author: Jürg Billeter <j bitron ch>
Date:   Mon Sep 13 19:26:30 2010 +0200

    codegen: Fix missing _inner_error_ declaration in destructors
    
    Fixes bug 629366.

 codegen/valagtypemodule.vala |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index d6da086..f85a3ed 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1636,10 +1636,6 @@ public class Vala.GTypeModule : GErrorModule {
 
 			ccode.add_declaration ("%s *".printf (cl.get_cname ()), new CCodeVariableDeclarator ("self"));
 			ccode.add_expression (new CCodeAssignment (new CCodeIdentifier ("self"), ccall));
-
-			if (cl.destructor != null) {
-				cl.destructor.body.emit (this);
-			}
 		} else {
 			var function = new CCodeFunction (cl.get_lower_case_cprefix () + "free", "void");
 			if (cl.access == SymbolAccessibility.PRIVATE) {
@@ -1649,9 +1645,13 @@ public class Vala.GTypeModule : GErrorModule {
 			function.add_parameter (new CCodeFormalParameter ("self", cl.get_cname () + "*"));
 
 			push_function (function);
+		}
+
+		if (cl.destructor != null) {
+			cl.destructor.body.emit (this);
 
-			if (cl.destructor != null) {
-				cl.destructor.body.emit (this);
+			if (current_method_inner_error) {
+				ccode.add_declaration ("GError *", new CCodeVariableDeclarator.zero ("_inner_error_", new CCodeConstant ("NULL")));
 			}
 		}
 



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