aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/server.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-04-18 16:28:01 -0500
committerTed Gould <ted@gould.cx>2011-04-18 16:28:01 -0500
commit74d51c3bd4e3f86939c37e4f5b1ca0835f4c868b (patch)
tree52b833b485e8528924dd724e359f4c583195f850 /libdbusmenu-glib/server.c
parentd6e3ac7ddd67f862db0fc7b8cf71d015326b1eac (diff)
downloadlibdbusmenu-74d51c3bd4e3f86939c37e4f5b1ca0835f4c868b.tar.gz
libdbusmenu-74d51c3bd4e3f86939c37e4f5b1ca0835f4c868b.tar.bz2
libdbusmenu-74d51c3bd4e3f86939c37e4f5b1ca0835f4c868b.zip
Referencing the server for as long as we're looking up the bus.
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r--libdbusmenu-glib/server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index a41e6ce..4c3732f 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -455,6 +455,7 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec)
g_return_if_fail(priv->bus_lookup != NULL);
}
+ g_object_ref(obj);
g_bus_get(G_BUS_TYPE_SESSION, priv->bus_lookup, bus_got_cb, obj);
} else {
register_object(DBUSMENU_SERVER(obj));
@@ -694,6 +695,7 @@ bus_got_cb (GObject * obj, GAsyncResult * result, gpointer user_data)
if (error != NULL) {
g_warning("Unable to get session bus: %s", error->message);
g_error_free(error);
+ g_object_unref(G_OBJECT(user_data));
return;
}
@@ -706,6 +708,7 @@ bus_got_cb (GObject * obj, GAsyncResult * result, gpointer user_data)
register_object(DBUSMENU_SERVER(user_data));
+ g_object_unref(G_OBJECT(user_data));
return;
}