From 5cbd814d497c6772424cc555812da620370db37b Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 26 Sep 2013 17:12:02 -0600 Subject: fix for SH-4523: interesting: viewer sometimes doesn't save objectcache file on disconnect from region --- indra/newview/llvocache.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 25dd1f4d07..91a5d4f973 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -312,11 +312,6 @@ void LLVOCacheEntry::dump() const BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const { - if(!mEntry) - { - return FALSE; - } - BOOL success; success = check_write(apr_file, (void*)&mLocalID, sizeof(U32)); if(success) @@ -1191,7 +1186,7 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca if(success) { - for (S32 i = 0; i < num_entries; i++) + for (S32 i = 0; i < num_entries && apr_file.eof() != APR_EOF; i++) { LLPointer entry = new LLVOCacheEntry(&apr_file); if (!entry->getLocalID()) @@ -1308,6 +1303,10 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: if(!removal_enabled || iter->second->isTouched()) { success = iter->second->writeToFile(&apr_file) ; + if(!success) + { + break; + } } } } @@ -1316,7 +1315,6 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: if(!success) { removeEntry(entry) ; - } return ; -- cgit v1.2.3