1
0
Fork 0

Fix some weird crashes. not real fix. more a workaround to prevent the crash(1201519)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2222
This commit is contained in:
Peter Veenstra 2005-06-22 19:41:36 +00:00
parent 990701f420
commit f3ef0ec55c

View file

@ -235,10 +235,13 @@ void CacheBlock::Clear(void) {
}
if (link[ind].to!=&link_blocks[ind]) {
CacheBlock * * wherelink=&link[ind].to->link[ind].from;
while (*wherelink!=this) {
wherelink=&(*wherelink)->link[ind].next;
while (*wherelink != this && *wherelink) {
wherelink = &(*wherelink)->link[ind].next;
}
*wherelink=(*wherelink)->link[ind].next;
if(*wherelink)
*wherelink = (*wherelink)->link[ind].next;
else
LOG(LOG_CPU,LOG_ERROR)("Cache anomaly. please investigate");
}
} else
cache_addunsedblock(this);