summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-09-26 17:12:02 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-09-26 17:12:02 -0600
commit5cbd814d497c6772424cc555812da620370db37b (patch)
tree4ebd3b472872b33d86792069d3b9074f81b86b7b /indra/newview
parent1733be96680e7ceb1911acc6af7fa3e12282fad7 (diff)
fix for SH-4523: interesting: viewer sometimes doesn't save objectcache file on disconnect from region
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llvocache.cpp12
1 files changed, 5 insertions, 7 deletions
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<LLVOCacheEntry> 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 ;