From 00254c0677481dc08d66ef7d1a2ab01b06983916 Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Wed, 16 Apr 2008 21:05:06 +0000 Subject: [PATCH] fix error handling in static constructors, fixes bug 528111 2008-04-16 Juerg Billeter * gobject/valaccodegenerator.vala: fix error handling in static constructors, fixes bug 528111 svn path=/trunk/; revision=1249 --- ChangeLog | 5 +++++ gobject/valaccodegenerator.vala | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index f3d4663..7bdf63a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-16 Jürg Billeter + * gobject/valaccodegenerator.vala: fix error handling in static + constructors, fixes bug 528111 + +2008-04-16 Jürg Billeter + * vapi/dbus-glib-1.vapi: fix dbus_connection_setup_with_g_main binding 2008-04-16 Jürg Billeter diff --git a/gobject/valaccodegenerator.vala b/gobject/valaccodegenerator.vala index 654af43..f9da4d4 100644 --- a/gobject/valaccodegenerator.vala +++ b/gobject/valaccodegenerator.vala @@ -983,6 +983,16 @@ public class Vala.CCodeGenerator : CodeGenerator { } else { // static class constructor // add to class_init + + if (current_method_inner_error) { + /* always separate error parameter and inner_error local variable + * as error may be set to NULL but we're always interested in inner errors + */ + var cdecl = new CCodeDeclaration ("GError *"); + cdecl.add_declarator (new CCodeVariableDeclarator.with_initializer ("inner_error", new CCodeConstant ("NULL"))); + class_init_fragment.append (cdecl); + } + class_init_fragment.append (c.body.ccodenode); } } -- 2.7.4