diff options
author | Teemu Ikonen <tpikonen@mailbox.org> | 2022-01-11 11:48:59 +0200 |
---|---|---|
committer | Teemu Ikonen <tpikonen@mailbox.org> | 2022-01-15 19:36:11 +0200 |
commit | 7320075e2d58dcd8d7ed903044aa9cc48996b37f (patch) | |
tree | 73be1acee36658439e6644db2c12ac35696a122a | |
parent | 5387be98400f83a32cad47a066261b5ff0950395 (diff) | |
download | geoclue-7320075e2d58dcd8d7ed903044aa9cc48996b37f.tar.gz |
service-manager: Add on_client_info_new_ready_data_free()
Move the definition of OnClientInfoNewReadyData to the start of the file
and add function on_client_info_new_ready_data_free to make using
OnClientInfoNewReadyData with GLib containers easier.
-rw-r--r-- | src/gclue-service-manager.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gclue-service-manager.c b/src/gclue-service-manager.c index 016cd3f..69fba51 100644 --- a/src/gclue-service-manager.c +++ b/src/gclue-service-manager.c @@ -73,6 +73,21 @@ enum static GParamSpec *gParamSpecs[LAST_PROP]; +typedef struct +{ + GClueDBusManager *manager; + GDBusMethodInvocation *invocation; + GClueClientInfo *client_info; + gboolean reuse_client; + +} OnClientInfoNewReadyData; + +static void +on_client_info_new_ready_data_free (gpointer data) +{ + g_slice_free (OnClientInfoNewReadyData, data); +} + static void sync_in_use_property (GClueServiceManager *manager) { @@ -163,15 +178,6 @@ on_peer_vanished (GClueClientInfo *info, (char *) bus_name); } -typedef struct -{ - GClueDBusManager *manager; - GDBusMethodInvocation *invocation; - GClueClientInfo *client_info; - gboolean reuse_client; - -} OnClientInfoNewReadyData; - static gboolean complete_get_client (OnClientInfoNewReadyData *data) { @@ -253,7 +259,7 @@ error_out: out: g_clear_error (&error); g_clear_object (&info); - g_slice_free (OnClientInfoNewReadyData, data); + on_client_info_new_ready_data_free (data); g_free (path); return FALSE; |