13
0

stop endless loop in WaveViewCache::cache_flush()

Still need to figure out how this could ever happen. It requires an image (shared pointer) to
be in the linear cache image list but not in the map
This commit is contained in:
Paul Davis 2015-06-22 22:00:45 -04:00
parent 32924aa7b8
commit 239052759f

View File

@ -1722,16 +1722,13 @@ WaveViewCache::cache_flush ()
sort (cache_list.begin(), cache_list.end(), sorter);
while (image_cache_size > _image_cache_threshold) {
while (image_cache_size > _image_cache_threshold && !cache_map.empty() && !cache_list.empty()) {
ListEntry& le (cache_list.front());
ImageCache::iterator x;
if ((x = cache_map.find (le.first)) == cache_map.end ()) {
/* wierd ... no entry for this AudioSource */
continue;
}
if ((x = cache_map.find (le.first)) != cache_map.end ()) {
CacheLine& cl = x->second;
@ -1759,8 +1756,11 @@ WaveViewCache::cache_flush ()
} else {
image_cache_size = 0;
}
}
/* Remove from the linear list */
/* Remove from the linear list, even if we didn't find it in
* the actual cache_mao
*/
cache_list.erase (cache_list.begin());
}
}