module: remove resource listener in cleanup

Remove the resource listener before destroying the object because that
will trigger the resource cleanup again.
This commit is contained in:
Wim Taymans 2018-09-24 09:30:14 +02:00
parent 8a88c6da53
commit 8a562c4427
2 changed files with 2 additions and 0 deletions

View file

@ -64,6 +64,7 @@ struct node_data {
static void resource_destroy(void *data) static void resource_destroy(void *data)
{ {
struct node_data *nd = data; struct node_data *nd = data;
spa_hook_remove(&nd->resource_listener);
if (nd->dsp) if (nd->dsp)
pw_node_destroy(nd->dsp); pw_node_destroy(nd->dsp);
} }

View file

@ -57,6 +57,7 @@ struct link_data {
static void resource_destroy(void *data) static void resource_destroy(void *data)
{ {
struct link_data *ld = data; struct link_data *ld = data;
spa_hook_remove(&ld->resource_listener);
if (ld->link) if (ld->link)
pw_link_destroy(ld->link); pw_link_destroy(ld->link);
} }