summaryrefslogtreecommitdiff
path: root/libgeoclue
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2019-03-06 17:19:52 +0100
committerBenjamin Berg <bberg@redhat.com>2019-03-07 13:38:56 +0100
commitbfb015528198675c3829241e670031f20a9ca526 (patch)
tree158d55182df938aee2a5173ecf463600004bb8a2 /libgeoclue
parent044418f5005758097f2babff1f35184947ce0c03 (diff)
downloadgeoclue-bfb015528198675c3829241e670031f20a9ca526.tar.gz
lib: Automatically delete client on server when using GClueSimple
When using GClueSimple, the user will not be managing the GClueClientProxy directly. In this case, it makes sense to set things up so that the client is deleted from the server again on object destruction. Fixes: #102
Diffstat (limited to 'libgeoclue')
-rw-r--r--libgeoclue/gclue-simple.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libgeoclue/gclue-simple.c b/libgeoclue/gclue-simple.c
index 8facc7e..33958e0 100644
--- a/libgeoclue/gclue-simple.c
+++ b/libgeoclue/gclue-simple.c
@@ -308,7 +308,7 @@ on_client_created (GObject *source_object,
GClueSimplePrivate *priv = simple->priv;
GError *error = NULL;
- priv->client = gclue_client_proxy_create_finish (res, &error);
+ priv->client = gclue_client_proxy_create_full_finish (res, &error);
if (error != NULL) {
g_task_return_error (task, error);
g_clear_object (&priv->task);
@@ -341,11 +341,12 @@ gclue_simple_init_async (GAsyncInitable *initable,
task = g_task_new (initable, cancellable, callback, user_data);
- gclue_client_proxy_create (simple->priv->desktop_id,
- simple->priv->accuracy_level,
- cancellable,
- on_client_created,
- task);
+ gclue_client_proxy_create_full (simple->priv->desktop_id,
+ simple->priv->accuracy_level,
+ GCLUE_CLIENT_PROXY_CREATE_AUTO_DELETE,
+ cancellable,
+ on_client_created,
+ task);
}
static gboolean