summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2008-04-22 18:32:29 -0400
committerZack Rusin <[email protected]>2008-04-22 18:32:36 -0400
commit36feb5eacf16467d06d5cd9f63d19f17f933f1ef (patch)
treecb9d08282dc92b8330c87677679459c8df4d2707 /src/gallium/auxiliary/cso_cache
parentd8f2e400cfe6e32e82d1656d3483905343124b97 (diff)
In case the 'func' is deleting the state move the iterator before
calling it.
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_cache.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}