In case the 'func' is deleting the state move the iterator before

calling it.
This commit is contained in:
Zack Rusin 2008-04-22 18:32:29 -04:00
parent d8f2e400cf
commit 36feb5eacf
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
}