- make Cache_Flush catch errors before Cache_Flush, and hopefully

print useful debugging info
This commit is contained in:
Adam Olsen 2001-11-25 03:16:15 +00:00
parent b7cbc15508
commit 82095df9cf

View file

@ -766,8 +766,13 @@ void
Cache_Flush (void)
{
CACHE_WRITE_LOCK;
while (cache_head.next != &cache_head)
while (cache_head.next != &cache_head) {
if (!cache_head.next->user->data)
Sys_Error ("Cache_Flush: user/system out of sync for "
"'%s' with %d size",
cache_head.next->name, cache_head.next->size);
Cache_RealFree (cache_head.next->user); // reclaim the space
}
CACHE_WRITE_UNLOCK;
}