Skip to content

Commit

Permalink
Keep the g_clear_pointer call
Browse files Browse the repository at this point in the history
Otherwise most tests fail to run. So I added a helper function
that does the proper casting to struct pw_proxy *.
  • Loading branch information
antlarr committed Feb 12, 2025
1 parent 8c67b22 commit c801a03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
Expand Down

0 comments on commit c801a03

Please sign in to comment.