From: Zack Rusin Date: Tue, 22 Apr 2008 22:32:29 +0000 (-0400) Subject: In case the 'func' is deleting the state move the iterator before X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=36feb5eacf16467d06d5cd9f63d19f17f933f1ef;p=mesa.git In case the 'func' is deleting the state move the iterator before calling it. --- diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.c b/src/gallium/auxiliary/cso_cache/cso_cache.c index f607528fdc7..63464e07058 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.c +++ b/src/gallium/auxiliary/cso_cache/cso_cache.c @@ -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); } }