aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-11-12 15:04:45 -0600
committerTed Gould <ted@gould.cx>2010-11-12 15:04:45 -0600
commit08053906621fc5240e7bb7a549a09b0acf930809 (patch)
tree0e24eff87fb8b871f306308b5bd08f1d538b4769 /libdbusmenu-glib
parentefd88243d8e4e8911f08e86744ef13387ac4ae6a (diff)
downloadlibdbusmenu-08053906621fc5240e7bb7a549a09b0acf930809.tar.gz
libdbusmenu-08053906621fc5240e7bb7a549a09b0acf930809.tar.bz2
libdbusmenu-08053906621fc5240e7bb7a549a09b0acf930809.zip
Adding a cancellable for the menu proxy in the private object
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 30dce89..17f52b4 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -73,6 +73,8 @@ struct _DbusmenuClientPrivate
GCancellable * session_bus_cancel;
GDBusProxy * menuproxy;
+ GCancellable * menuproxy_cancel;
+
GCancellable * layoutcall;
gint current_revision;
@@ -288,6 +290,8 @@ dbusmenu_client_init (DbusmenuClient *self)
priv->session_bus_cancel = NULL;
priv->menuproxy = NULL;
+ priv->menuproxy_cancel = NULL;
+
priv->layoutcall = NULL;
priv->current_revision = 0;
@@ -352,15 +356,26 @@ dbusmenu_client_dispose (GObject *object)
dbus_g_proxy_cancel_call(priv->menuproxy, priv->layoutcall);
priv->layoutcall = NULL;
}
+
+ /* Bring down the menu proxy, ensure we're not
+ looking for one at the same time. */
+ if (priv->menuproxy_cancel != NULL) {
+ g_cancellable_cancel(priv->menuproxy_cancel);
+ g_object_unref(priv->menuproxy_cancel);
+ priv->menuproxy_cancel = NULL;
+ }
if (priv->menuproxy != NULL) {
g_object_unref(G_OBJECT(priv->menuproxy));
priv->menuproxy = NULL;
}
+
if (priv->dbusproxy != NULL) {
g_object_unref(G_OBJECT(priv->dbusproxy));
priv->dbusproxy = NULL;
}
+ /* Bring down the session bus, ensure we're not
+ looking for one at the same time. */
if (priv->session_bus_cancel != NULL) {
g_cancellable_cancel(priv->session_bus_cancel);
g_object_unref(priv->session_bus_cancel);