list: use spa_list_consume some more

If we know the item is removed in each iteration, _consume can handle
deletion of any item while being iterated.
This commit is contained in:
Wim Taymans 2019-05-23 09:56:02 +02:00
parent 58fa5561b8
commit fbf6acd271
2 changed files with 6 additions and 6 deletions

View file

@ -144,11 +144,11 @@ static const struct pw_factory_implementation factory_impl = {
static void factory_destroy(void *_data)
{
struct factory_data *data = _data;
struct node_data *nd, *t;
struct node_data *nd;
spa_hook_remove(&data->module_listener);
spa_list_for_each_safe(nd, t, &data->node_list, link)
spa_list_consume(nd, &data->node_list, link)
pw_node_destroy(nd->node);
if (data->properties)