mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-02-05 09:00:27 +01:00
daemon: use a different GList pointer to iterate the components list
This keeps the original head pointer intact, so that we can effectively free the list later. If we use the head pointer to iterate, then at the end we are not freeing anything because the pointer is NULL
This commit is contained in:
parent
e55e8bb447
commit
7ed188fba3
1 changed files with 5 additions and 3 deletions
|
|
@ -86,6 +86,7 @@ struct _WpInitTransition
|
|||
WpTransition parent;
|
||||
WpObjectManager *om;
|
||||
GList *components;
|
||||
GList *components_iter;
|
||||
ComponentData *curr_component;
|
||||
};
|
||||
|
||||
|
|
@ -164,11 +165,11 @@ load_enable_components (WpInitTransition *self)
|
|||
{
|
||||
WpCore *core = wp_transition_get_source_object (WP_TRANSITION (self));
|
||||
|
||||
while (self->components) {
|
||||
self->curr_component = (ComponentData *) self->components->data;
|
||||
while (self->components_iter) {
|
||||
self->curr_component = (ComponentData *) self->components_iter->data;
|
||||
|
||||
/* Advance */
|
||||
self->components = g_list_next (self->components);
|
||||
self->components_iter = g_list_next (self->components_iter);
|
||||
|
||||
/* Skip component if its dependencies are not met */
|
||||
if (!component_meets_dependencies (core, self->curr_component)) {
|
||||
|
|
@ -415,6 +416,7 @@ wp_init_transition_execute_step (WpTransition * transition, guint step)
|
|||
if (json_comps)
|
||||
append_json_components (&self->components, json_comps);
|
||||
|
||||
self->components_iter = g_list_first (self->components);
|
||||
wp_transition_advance (transition);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue