One more crashing instance for hashes
authorAntony Riakiotakis <kalast@gmail.com>
Fri, 6 Feb 2015 16:39:26 +0000 (17:39 +0100)
committerAntony Riakiotakis <kalast@gmail.com>
Fri, 6 Feb 2015 16:39:26 +0000 (17:39 +0100)
source/blender/imbuf/intern/moviecache.c

index a068304e1ce0f85fe96155f08bc74dfdc4b5bfb2..29bb35986e86ab0dbd689295d6f67f3ae96789de 100644 (file)
@@ -476,10 +476,14 @@ void IMB_moviecache_cleanup(MovieCache *cache, bool (cleanup_check_cb) (ImBuf *i
 
        check_unused_keys(cache);
 
-       GHASH_ITER(gh_iter, cache->hash) {
+       BLI_ghashIterator_init(&gh_iter, cache->hash);
+
+       while (!BLI_ghashIterator_done(&gh_iter)) {
                MovieCacheKey *key = BLI_ghashIterator_getKey(&gh_iter);
                MovieCacheItem *item = BLI_ghashIterator_getValue(&gh_iter);
 
+               BLI_ghashIterator_step(&gh_iter);
+
                if (cleanup_check_cb(item->ibuf, key->userkey, userdata)) {
                        PRINT("%s: cache '%s' remove item %p\n", __func__, cache->name, item);