spa: don't free the mix_list ports

We can't move the mix_list ports to the free_list like that because the
elements in the list use a different list to link together. Also, we
don't need to free those ports at all because they will be freed when we
move the port_list to the free_list.
This commit is contained in:
Wim Taymans 2025-07-31 10:20:59 +02:00
parent 5743849b50
commit 4715e36a5c
4 changed files with 2 additions and 7 deletions

View file

@ -177,7 +177,6 @@ static int uninit_stream(struct seq_state *state, enum spa_direction direction)
{
struct seq_stream *stream = &state->streams[direction];
spa_list_insert_list(&state->free_list, &stream->port_list);
spa_list_insert_list(&state->free_list, &stream->mix_list);
if (stream->codec)
snd_midi_event_free(stream->codec);
stream->codec = NULL;

View file

@ -926,11 +926,11 @@ static int impl_clear(struct spa_handle *handle)
this = (struct impl *) handle;
spa_list_insert_list(&this->free_list, &this->port_list);
spa_list_insert_list(&this->free_list, &this->mix_list);
spa_list_consume(port, &this->free_list, link) {
spa_list_remove(&port->link);
free(port);
}
spa_list_init(&this->mix_list);
mix_ops_free(&this->ops);
return 0;
}

View file

@ -863,10 +863,7 @@ static int impl_clear(struct spa_handle *handle)
this = (struct impl *) handle;
spa_list_consume(port, &this->port_list, link) {
spa_list_remove(&port->link);
free(port);
}
spa_list_insert_list(&this->free_list, &this->port_list);
spa_list_consume(port, &this->free_list, link) {
spa_list_remove(&port->link);
free(port);

View file

@ -909,7 +909,6 @@ static int impl_clear(struct spa_handle *handle)
this = (struct impl *) handle;
spa_list_insert_list(&this->free_list, &this->port_list);
spa_list_insert_list(&this->free_list, &this->mix_list);
spa_list_consume(port, &this->free_list, link) {
spa_list_remove(&port->link);
free(port);