clean up listeners

This commit is contained in:
Wim Taymans 2018-05-17 17:30:30 +02:00
parent 69d4144932
commit 6450c64542
3 changed files with 3 additions and 0 deletions

View file

@ -1136,6 +1136,7 @@ static void client_node_resource_destroy(void *data)
pw_log_debug("client-node %p: destroy", impl); pw_log_debug("client-node %p: destroy", impl);
impl->node.resource = this->resource = NULL; impl->node.resource = this->resource = NULL;
spa_hook_remove(&impl->resource_listener);
if (node->data_source.fd != -1) { if (node->data_source.fd != -1) {
spa_loop_invoke(node->data_loop, spa_loop_invoke(node->data_loop,

View file

@ -52,6 +52,7 @@ static void node_destroy(void *data)
{ {
struct node_data *nd = data; struct node_data *nd = data;
spa_list_remove(&nd->link); spa_list_remove(&nd->link);
spa_hook_remove(&nd->node_listener);
} }
static const struct pw_node_events node_events = { static const struct pw_node_events node_events = {

View file

@ -62,6 +62,7 @@ static void pw_spa_node_destroy(void *data)
pw_log_debug("spa-node %p: destroy", node); pw_log_debug("spa-node %p: destroy", node);
spa_hook_remove(&impl->node_listener);
if (impl->handle) { if (impl->handle) {
spa_handle_clear(impl->handle); spa_handle_clear(impl->handle);
free(impl->handle); free(impl->handle);