mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-19 16:01:45 +00:00
map: don't mix insert_at() and _remove()
You are supposed to allocate with _insert_new()/_remove() or use someone elses allocated number with _insert_at(), never mix the two or it will give an error.
This commit is contained in:
parent
f6b1d65e35
commit
f39f9b207b
|
@ -1067,10 +1067,10 @@ static void pw_impl_port_remove(struct pw_impl_port *port)
|
|||
}
|
||||
|
||||
if (port->direction == PW_DIRECTION_INPUT) {
|
||||
pw_map_remove(&node->input_port_map, port->port_id);
|
||||
pw_map_insert_at(&node->input_port_map, port->port_id, NULL);
|
||||
node->info.n_input_ports--;
|
||||
} else {
|
||||
pw_map_remove(&node->output_port_map, port->port_id);
|
||||
pw_map_insert_at(&node->output_port_map, port->port_id, NULL);
|
||||
node->info.n_output_ports--;
|
||||
}
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ static int destroy_global(void *obj, void *data)
|
|||
if (global == NULL)
|
||||
return 0;
|
||||
|
||||
pw_map_remove(&global->rd->globals, global->id);
|
||||
pw_map_insert_at(&global->rd->globals, global->id, NULL);
|
||||
pw_properties_free(global->properties);
|
||||
free(global->type);
|
||||
free(global);
|
||||
|
|
Loading…
Reference in a new issue