From d23ca44c07ddf691ae41b4a6c5c10b794f1de765 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Jul 2010 10:47:58 -0500 Subject: Actually creating a proxy to see if we can detect the watcher going away. --- libindicator/indicator-service.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index d3e873b..01fabce 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -387,9 +387,19 @@ _indicator_service_server_watch (IndicatorService * service, DBusGMethodInvocati const gchar * sender = dbus_g_method_get_sender(method); if (g_hash_table_lookup(priv->watchers, sender) == NULL) { - DBusGProxy * senderproxy = (gpointer)1; - - g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + GError * error = NULL; + DBusGProxy * senderproxy = dbus_g_proxy_new_for_name_owner(priv->bus, + sender, + "/", + DBUS_INTERFACE_INTROSPECTABLE, + &error); + + if (error == NULL) { + g_hash_table_insert(priv->watchers, g_strdup(sender), senderproxy); + } else { + g_warning("Unable to create proxy for watcher '%s': %s", sender, error->message); + g_error_free(error); + } } if (priv->timeout != 0) { -- cgit v1.2.3