In case the 'func' is deleting the state move the iterator before
calling it.
This commit is contained in:
parent
d8f2e400cf
commit
36feb5eacf
|
@ -334,10 +334,10 @@ void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
|
|||
iter = cso_hash_first_node(hash);
|
||||
while (!cso_hash_iter_is_null(iter)) {
|
||||
void *state = cso_hash_iter_data(iter);
|
||||
iter = cso_hash_iter_next(iter);
|
||||
if (state) {
|
||||
func(state, user_data);
|
||||
}
|
||||
iter = cso_hash_iter_next(iter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue