aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-01 10:19:11 -0600
committerTed Gould <ted@gould.cx>2009-12-01 10:19:11 -0600
commit088eff44dd923a80d2bc357be72b9ace0c97d06e (patch)
tree36f5a10b029557691976579a7b047d45f435c753
parent67aef7b9c7d1044c60801a2b021bf1f7234feb18 (diff)
downloadlibayatana-indicator-088eff44dd923a80d2bc357be72b9ace0c97d06e.tar.gz
libayatana-indicator-088eff44dd923a80d2bc357be72b9ace0c97d06e.tar.bz2
libayatana-indicator-088eff44dd923a80d2bc357be72b9ace0c97d06e.zip
When destroying the object we tell the watched service that we're not watching it.
-rw-r--r--libindicator/indicator-service-manager.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c
index 4eaed23..956eb90 100644
--- a/libindicator/indicator-service-manager.c
+++ b/libindicator/indicator-service-manager.c
@@ -51,6 +51,7 @@ static void indicator_service_manager_finalize (GObject *object);
static void set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec);
static void get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec);
static void start_service (IndicatorServiceManager * service);
+static void unwatch_cb (DBusGProxy *proxy, GError *error, gpointer userdata);
G_DEFINE_TYPE (IndicatorServiceManager, indicator_service_manager, G_TYPE_OBJECT);
@@ -147,6 +148,12 @@ indicator_service_manager_dispose (GObject *object)
priv->dbus_proxy = NULL;
}
+ /* If we have a proxy, tell it we're shutting down. Just
+ to be polite about it. */
+ if (priv->service_proxy != NULL) {
+ org_ayatana_indicator_service_un_watch_async(priv->service_proxy, unwatch_cb, NULL);
+ }
+
/* Destory our service proxy, we won't need it. */
if (priv->service_proxy != NULL) {
g_object_unref(G_OBJECT(priv->service_proxy));
@@ -232,6 +239,12 @@ get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspe
}
static void
+unwatch_cb (DBusGProxy *proxy, GError *error, gpointer userdata)
+{
+ return;
+}
+
+static void
watch_cb (DBusGProxy * proxy, gint service_version, GError * error, gpointer user_data)
{
IndicatorServiceManagerPrivate * priv = INDICATOR_SERVICE_MANAGER_GET_PRIVATE(user_data);