[vala] D-Bus: Avoid redefinition of callback wrapper



commit 7f514c8b2c329b8b979f84c10c9e2ba84804a876
Author: Jürg Billeter <j bitron ch>
Date:   Mon Apr 6 20:39:23 2009 +0200

    D-Bus: Avoid redefinition of callback wrapper
---
 gobject/valadbusclientmodule.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gobject/valadbusclientmodule.vala b/gobject/valadbusclientmodule.vala
index 5a5214d..97dd8e3 100644
--- a/gobject/valadbusclientmodule.vala
+++ b/gobject/valadbusclientmodule.vala
@@ -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)));



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