summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinghua Luo <sunmoon1997@gmail.com>2007-02-04 00:51:53 +0800
committerJinghua Luo <sunmoon1997@gmail.com>2007-02-04 00:51:53 +0800
commit7bfa02a064762eef2aa321ca0da51b6ebc0f9090 (patch)
tree706e8f59772d0e758198e640e048e2b073ee68bb
parente71e18043588689c0a92a747347e1745ae5969ab (diff)
hash: fix a bug in itering code.
hash foreach will leak the dead entry to user this may lead badness to happen.
-rw-r--r--src/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index 12cad0d..cba156b 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -295,7 +295,7 @@ sdl_freetype_hash_foreach (sdl_freetype_hash_t * hash,
hash->itering++;
for (i = 0; i < hash->size; i++) {
- if (!hash->entries[i])
+ if (!hash->entries[i] || hash->entries[i] == &dead_entry)
continue;
func (hash, hash->entries[i], closure);
}