]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Avoid redefinition of callback wrapper
authorJürg Billeter <j@bitron.ch>
Mon, 6 Apr 2009 18:39:23 +0000 (20:39 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 6 Apr 2009 18:39:23 +0000 (20:39 +0200)
gobject/valadbusclientmodule.vala

index 5a5214d7154c7523c53f7d7b7231d1d95c573e30..97dd8e3853872c8a356002335211913d4fea2494 100644 (file)
@@ -179,7 +179,11 @@ internal class Vala.DBusClientModule : DBusModule {
                        cb_fun.block.add_statement (new CCodeExpressionStatement (cend_call));
                        creply_call.add_argument (new CCodeIdentifier ("error"));
                        cb_fun.block.add_statement (new CCodeExpressionStatement (creply_call));
-                       source_type_member_definition.append (cb_fun);
+
+                       if (!source_declarations.add_declaration (cb_fun.name)) {
+                               // avoid duplicate function definition
+                               source_type_member_definition.append (cb_fun);
+                       }
 
                        ccall.add_argument (new CCodeIdentifier (cb_fun.name));
                        ccall.add_argument (new CCodeConstant ("param%d_target".printf (callback_index)));