[vala/0.10] D-Bus: Fix warning and leak in proxy creation in dbus-glib clients



commit ada58e3dd989d6e47c65aaa6ccb904fdf61b08f2
Author: Jürg Billeter <j bitron ch>
Date:   Sun Jan 9 00:01:15 2011 +0100

    D-Bus: Fix warning and leak in proxy creation in dbus-glib clients

 codegen/valadbusclientmodule.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valadbusclientmodule.vala b/codegen/valadbusclientmodule.vala
index d8c2da6..c54bfeb 100644
--- a/codegen/valadbusclientmodule.vala
+++ b/codegen/valadbusclientmodule.vala
@@ -1401,6 +1401,13 @@ public class Vala.DBusClientModule : DBusModule {
 		var mtype = expr.call.value_type as MethodType;
 		bool proxy_new_from_type = (mtype != null && mtype.method_symbol.get_cname () == "dbus_g_proxy_new_from_type");
 		bool proxy_get_all = (mtype != null && mtype.method_symbol.get_cname () == "dbus_g_proxy_get_all");
+
+		bool proxy_new_for_name = (mtype != null && mtype.method_symbol.get_cname () == "dbus_g_proxy_new_for_name");
+		if (proxy_new_for_name && expr.parent_node is CastExpression) {
+			// method call handled by visit_cast_expression
+			return;
+		}
+
 		if (!proxy_new_from_type && !proxy_get_all) {
 			base.visit_method_call (expr);
 			return;



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