From 311b458d560d58b9a25e0e579f45b91f4b3a41b2 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 29 Mar 2010 06:28:46 +0000 Subject: Forbid contents with active fetches from being cleaned. svn path=/trunk/netsurf/; revision=10199 --- content/llcache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'content') diff --git a/content/llcache.c b/content/llcache.c index 33f707f48..5527a232d 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -1149,12 +1149,13 @@ nserror llcache_clean(void) * 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) { next = object->next; /* 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 LOG(("Found victim %p", object)); #endif @@ -1169,7 +1170,8 @@ nserror llcache_clean(void) next = object->next; 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 LOG(("Found victim %p", object)); #endif -- cgit v1.2.3