diff options
author | Benjamin Berg <bberg@redhat.com> | 2019-03-06 17:19:52 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2019-03-07 13:38:56 +0100 |
commit | bfb015528198675c3829241e670031f20a9ca526 (patch) | |
tree | 158d55182df938aee2a5173ecf463600004bb8a2 | |
parent | 044418f5005758097f2babff1f35184947ce0c03 (diff) | |
download | geoclue-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
-rw-r--r-- | libgeoclue/gclue-simple.c | 13 |
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 |