summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-03-29 11:28:42 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-03-29 11:28:42 -0600
commita0022e65ec41b1ce0868d75643338510921d1b6b (patch)
tree336acecd98936c193f5d2228b3fb9b94cb62c8ac
parent7bd603544e07b54acc2828e8b9763445d82b8c80 (diff)
fix for EXT-6566: crash at LLTextureCache::updatedHeaderEntriesFile [secondlife-bin lltexturecache.cpp:1292]
-rw-r--r--indra/newview/lltexturecache.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index dce7d8da40..aa081ff7bb 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1266,9 +1266,17 @@ U32 LLTextureCache::openAndReadEntries(std::vector<Entry>& entries)
mFreeList.clear();
mTexturesSizeTotal = 0;
- LLAPRFile* aprfile = openHeaderEntriesFile(true, 0);
+ LLAPRFile* aprfile = NULL;
+ if(mUpdatedEntryMap.empty())
+ {
+ aprfile = openHeaderEntriesFile(true, (S32)sizeof(EntriesInfo));
+ }
+ else //update the header file first.
+ {
+ aprfile = openHeaderEntriesFile(false, 0);
updatedHeaderEntriesFile() ;
aprfile->seek(APR_SET, (S32)sizeof(EntriesInfo));
+ }
for (U32 idx=0; idx<num_entries; idx++)
{
Entry entry;