aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-10-14 11:17:23 -0500
committerTed Gould <ted@gould.cx>2010-10-14 11:17:23 -0500
commit23b8623959467e965c83b8bd6458575c0eca34cb (patch)
tree127cf295612d28b3021a8123b2970cf914d6a502
parentf309ec2bb22cda3e2f763f96bb6a08652d9373d8 (diff)
downloadlibdbusmenu-23b8623959467e965c83b8bd6458575c0eca34cb.tar.gz
libdbusmenu-23b8623959467e965c83b8bd6458575c0eca34cb.tar.bz2
libdbusmenu-23b8623959467e965c83b8bd6458575c0eca34cb.zip
Setting up the private variables that we're going to do need to set this stuff up
-rw-r--r--libdbusmenu-glib/server.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index bbccd73..6f5d45c 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -61,6 +61,10 @@ struct _DbusmenuServerPrivate
gchar * dbusobject;
gint layout_revision;
guint layout_idle;
+
+ GDBusConnection * bus;
+ GCancellable * bus_lookup;
+ guint dbus_registration;
};
#define DBUSMENU_SERVER_GET_PRIVATE(o) (DBUSMENU_SERVER(o)->priv)
@@ -241,6 +245,9 @@ dbusmenu_server_init (DbusmenuServer *self)
priv->dbusobject = NULL;
priv->layout_revision = 1;
priv->layout_idle = 0;
+ priv->bus = NULL;
+ priv->bus_lookup = NULL;
+ priv->dbus_registration = 0;
return;
}
@@ -259,6 +266,27 @@ dbusmenu_server_dispose (GObject *object)
g_object_unref(priv->root);
}
+ if (priv->dbus_registration != 0) {
+ g_dbus_connection_unregister_object(priv->bus, priv->dbus_registration);
+ priv->dbus_registration = 0;
+ }
+
+ if (priv->bus != NULL) {
+ g_object_unref(priv->bus);
+ priv->bus = NULL;
+ }
+
+ if (priv->bus_lookup != NULL) {
+ if (!g_cancellable_is_cancelled(priv->bus_lookup)) {
+ /* Note, this may case the async function to run at
+ some point in the future. That's okay, it'll get an
+ error, but just FYI */
+ g_cancellable_cancel(priv->bus_lookup);
+ }
+ g_object_unref(priv->bus_lookup);
+ priv->bus_lookup = NULL;
+ }
+
G_OBJECT_CLASS (dbusmenu_server_parent_class)->dispose (object);
return;
}