remove hooks from objects

Remove the hooks we installed on objects in the destroy/free event
or before calling _destroy. This is not really needed but it is
a nice thing to do because it calls the hook removed callbacks.
This commit is contained in:
Wim Taymans 2020-11-06 15:53:32 +01:00
parent 6317bc4deb
commit 1570e62635
19 changed files with 109 additions and 27 deletions

View file

@ -432,6 +432,10 @@ static void on_core_destroy(void *_data)
spa_list_remove(&rd->link);
spa_hook_remove(&rd->core_listener);
spa_hook_remove(&rd->registry_listener);
spa_hook_remove(&rd->proxy_core_listener);
pw_map_remove(&data->vars, rd->id);
pw_map_for_each(&rd->globals, destroy_global, rd);
pw_map_clear(&rd->globals);
@ -1111,6 +1115,9 @@ destroy_proxy (void *data)
{
struct proxy_data *pd = data;
spa_hook_remove(&pd->proxy_listener);
spa_hook_remove(&pd->object_listener);
if (pd->info == NULL)
return;