From c801a0306c1fd5057769fcaead2a0db58ad8e6dc Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Wed, 12 Feb 2025 18:59:47 +0100 Subject: [PATCH] Keep the g_clear_pointer call Otherwise most tests fail to run. So I added a helper function that does the proper casting to struct pw_proxy *. --- src/pipewire.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pipewire.c b/src/pipewire.c index 7b8d10411..645fdef7b 100644 --- a/src/pipewire.c +++ b/src/pipewire.c @@ -212,6 +212,11 @@ static GSourceFuncs pipewire_source_funcs = pipewire_loop_source_finalize }; +void pipewire_registry_destroy(struct pw_registry *registry) +{ + pw_proxy_destroy((struct pw_proxy *)registry); +} + void pipewire_remote_destroy (PipeWireRemote *remote) { @@ -224,8 +229,7 @@ pipewire_remote_destroy (PipeWireRemote *remote) /* This check is a workaround for older PW versions */ if (remote->registry) spa_hook_remove (&remote->registry_listener); - pw_proxy_destroy((struct pw_proxy *)remote->registry); - remote->registry = NULL; + g_clear_pointer (&remote->registry, pipewire_registry_destroy); g_clear_pointer (&remote->globals, g_hash_table_destroy); if (remote->core) spa_hook_remove (&remote->core_listener);