audio-dsp: clean ports when the node is destroyed

This commit is contained in:
Wim Taymans 2019-01-29 10:30:01 +01:00
parent 11769aa7e7
commit 718847fcd5

View file

@ -158,7 +158,14 @@ static const struct pw_port_implementation port_implementation = {
static void node_destroy(void *data) static void node_destroy(void *data)
{ {
struct node *n = data; struct node *n = data;
struct port *p, *tmp;
pw_properties_free(n->props); pw_properties_free(n->props);
spa_list_for_each_safe(p, tmp, &n->ports, link) {
spa_list_remove(&p->link);
spa_handle_clear(p->spa_handle);
free(p);
}
} }
static void node_port_init(void *data, struct pw_port *port) static void node_port_init(void *data, struct pw_port *port)