From: Carlos Garnacho Date: Mon, 6 Mar 2017 10:40:24 +0000 (+0100) Subject: codegen: Only add _error path if there's parameters that require unref X-Git-Tag: 0.35.7~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5d2c1b98752d063343ad87e4b1dcd790ea5d21c;p=thirdparty%2Fvala.git codegen: Only add _error path if there's parameters that require unref Fixes the _error label from being set at the end of a compound statement if there are no values to unref. https://bugzilla.gnome.org/show_bug.cgi?id=778540 --- diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala index 4f06210f7..2cb42710e 100644 --- a/codegen/valagdbusservermodule.vala +++ b/codegen/valagdbusservermodule.vala @@ -145,8 +145,12 @@ public class Vala.GDBusServerModule : GDBusClientModule { return_error.add_argument (new CCodeIdentifier ("error")); ccode.add_expression (return_error); - ccode.add_goto ("_error"); - need_goto_label = true; + if (need_goto_label || requires_destroy (owned_type)) { + ccode.add_goto ("_error"); + need_goto_label = true; + } else { + ccode.add_return (); + } ccode.close (); }