From 4dc217edcbe872c2a0bf99d661edf85c18700ba5 Mon Sep 17 00:00:00 2001 From: "wagic.jeck" Date: Thu, 22 Oct 2009 09:33:16 +0000 Subject: [PATCH] Jeck - Potential fix to issue 109, issue 112. Looks hopeful so far, please confirm (or confirm failure). * We only want to record misses when the file doesn't exist. Item can be null if we're out of memory for whatever reason, resulting in an invalid miss. --- projects/mtg/src/WResourceManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/WResourceManager.cpp b/projects/mtg/src/WResourceManager.cpp index a60eaaca5..0d3425064 100644 --- a/projects/mtg/src/WResourceManager.cpp +++ b/projects/mtg/src/WResourceManager.cpp @@ -1109,12 +1109,14 @@ cacheItem * WCache::Get(int id, string filename, int sty cacheItem * item = AttemptNew(filename,submode); if(style == RETRIEVE_MANAGE){ - managed[lookup] = item; //Record a hit or miss. + if(mError == CACHE_ERROR_404 || item) + managed[lookup] = item; //Record a hit or miss. if(item){ item->deadbolt(); //Make permanent. } } else { + if(mError == CACHE_ERROR_404 || item) cache[lookup] = item; }