diff --git a/compat/win32/fscache.c b/compat/win32/fscache.c index 18871fa36f..1a4f2c2a93 100644 --- a/compat/win32/fscache.c +++ b/compat/win32/fscache.c @@ -257,10 +257,13 @@ static void fscache_clear(void) { struct hashmap_iter iter; struct fsentry *fse; - while ((fse = hashmap_iter_first(&map, &iter))) { + hashmap_disallow_rehash(&map, 1); + hashmap_iter_init(&map, &iter); + while ((fse = hashmap_iter_next(&iter))) { fscache_remove(fse); fsentry_release(fse); } + hashmap_disallow_rehash(&map, 0); } /*