From 4ef2895a07690c2c4ffaa07ac426f85ef702584d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 14 Jan 2011 13:29:07 -0600 Subject: Saving the connection --- src/messages-service-dbus.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/messages-service-dbus.c b/src/messages-service-dbus.c index 1a9564b..44b35aa 100644 --- a/src/messages-service-dbus.c +++ b/src/messages-service-dbus.c @@ -41,6 +41,7 @@ typedef struct _MessageServiceDbusPrivate MessageServiceDbusPrivate; struct _MessageServiceDbusPrivate { + GDBusConnection * connection; gboolean dot; gboolean hidden; }; @@ -131,6 +132,9 @@ connection_cb (GObject * object, GAsyncResult * res, gpointer user_data) return; } + MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(user_data); + priv->connection = connection; + g_dbus_connection_register_object(connection, INDICATOR_MESSAGES_DBUS_SERVICE_OBJECT, bus_interface_info, @@ -166,7 +170,12 @@ message_service_dbus_init (MessageServiceDbus *self) static void message_service_dbus_dispose (GObject *object) { + MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(object); + if (priv->connection != NULL) { + g_object_unref(priv->connection); + priv->connection = NULL; + } G_OBJECT_CLASS (message_service_dbus_parent_class)->dispose (object); return; -- cgit v1.2.3