fix cleanup

When the node is destroyed, remove it from the node list and mark
the reference to the node gone so that when the resource is cleaned
up we don't try to destroy the node again.
This commit is contained in:
Wim Taymans 2018-09-20 10:13:00 +02:00
parent 3d1acf3032
commit b50482e346
2 changed files with 4 additions and 10 deletions

View file

@ -57,12 +57,8 @@ struct link_data {
static void resource_destroy(void *data)
{
struct link_data *ld = data;
spa_list_remove(&ld->l);
spa_hook_remove(&ld->resource_listener);
if (ld->link) {
spa_hook_remove(&ld->link_listener);
if (ld->link)
pw_link_destroy(ld->link);
}
}
static const struct pw_resource_events resource_events = {
@ -73,6 +69,7 @@ static const struct pw_resource_events resource_events = {
static void link_destroy(void *data)
{
struct link_data *ld = data;
spa_list_remove(&ld->l);
ld->link = NULL;
}