aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-14 13:29:07 -0600
committerTed Gould <ted@gould.cx>2011-01-14 13:29:07 -0600
commit4ef2895a07690c2c4ffaa07ac426f85ef702584d (patch)
treed84ca48a84b2e6f3ccc6ee83578c120bc75acfe5 /src
parent05e767ce2daf9cca389f482b4c8ad72c375944f5 (diff)
downloadayatana-indicator-messages-4ef2895a07690c2c4ffaa07ac426f85ef702584d.tar.gz
ayatana-indicator-messages-4ef2895a07690c2c4ffaa07ac426f85ef702584d.tar.bz2
ayatana-indicator-messages-4ef2895a07690c2c4ffaa07ac426f85ef702584d.zip
Saving the connection
Diffstat (limited to 'src')
-rw-r--r--src/messages-service-dbus.c9
1 files changed, 9 insertions, 0 deletions
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;