]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Fix warning and leak in proxy creation in dbus-glib clients
authorJürg Billeter <j@bitron.ch>
Sat, 8 Jan 2011 23:01:15 +0000 (00:01 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 22 Jan 2011 10:01:13 +0000 (11:01 +0100)
codegen/valadbusclientmodule.vala

index d8c2da6e75a0de70a57e589cf2367450324ffb34..c54bfeb7047ed7b80e214dadbec244dc70f4e12a 100644 (file)
@@ -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;