You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merged PR 224072: fscache: fix crash when clearing the cache
fscache: fix crash when clearing the cache
fscache_clear was crashing because when using hashmap_iter_next
method the next entry will be saved. Meanwhile the call to
fscache_release will free the directory and the list of entries
for the directory. This causes the next entry saved by the iter
to be freed, invalid and the crash with the next loop iteration.
This changes the clear to simple call hashmap_free to free
the hashmap and all the entries and then call hashmap_init to
reinitialize the hashmap for the next fscache use. The reason
this is safe is fscache_clear is only called from fscache_enable
when this cache is being disabled which is only called in
preload_index after all the thread have exited.
It is also guarded by the critical section mutex.
All tests passed https://mseng.visualstudio.com/VSOnline/GitForWindows/_build/index?buildId=3924754&_a=summary
Removed the fscache_remove method since it is no longer used.
0 commit comments