From: Juerg Billeter Date: Wed, 16 Apr 2008 21:05:06 +0000 (+0000) Subject: fix error handling in static constructors, fixes bug 528111 X-Git-Tag: VALA_0_3_1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00254c0677481dc08d66ef7d1a2ab01b06983916;p=thirdparty%2Fvala.git 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 --- diff --git a/ChangeLog b/ChangeLog index f3d466301..7bdf63a83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gobject/valaccodegenerator.vala b/gobject/valaccodegenerator.vala index 654af43d4..f9da4d418 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); } }