Forbid contents with active fetches from being cleaned.

svn path=/trunk/netsurf/; revision=10199
This commit is contained in:
John Mark Bell 2010-03-29 06:28:46 +00:00
parent 4e2c3a4c39
commit 311b458d56

View File

@ -1149,12 +1149,13 @@ nserror llcache_clean(void)
* 3) Fresh cacheable objects with no users or pending fetches * 3) Fresh cacheable objects with no users or pending fetches
*/ */
/* 1) Uncacheable objects with no users */ /* 1) Uncacheable objects with no users or fetches */
for (object = llcache_uncached_objects; object != NULL; object = next) { for (object = llcache_uncached_objects; object != NULL; object = next) {
next = object->next; next = object->next;
/* The candidate count of uncacheable objects is always 0 */ /* The candidate count of uncacheable objects is always 0 */
if (object->users == NULL && object->candidate_count == 0) { if (object->users == NULL && object->candidate_count == 0 &&
object->fetch.fetch == NULL) {
#ifdef LLCACHE_TRACE #ifdef LLCACHE_TRACE
LOG(("Found victim %p", object)); LOG(("Found victim %p", object));
#endif #endif
@ -1169,7 +1170,8 @@ nserror llcache_clean(void)
next = object->next; next = object->next;
if (object->users == NULL && object->candidate_count == 0 && if (object->users == NULL && object->candidate_count == 0 &&
llcache_object_is_fresh(object) == false) { llcache_object_is_fresh(object) == false &&
object->fetch.fetch == NULL) {
#ifdef LLCACHE_TRACE #ifdef LLCACHE_TRACE
LOG(("Found victim %p", object)); LOG(("Found victim %p", object));
#endif #endif