summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturecache.cpp
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
commit970b7051acbc23a504c40f23fb6180e45aa536ae (patch)
treeada5fbfed3bd30294799545e9ca689718d3f9712 /indra/newview/lltexturecache.cpp
parentfad31dc087cb670bd4479195cac2c31da9a55e57 (diff)
fix for EXT-6566: crash at LLTextureCache::updatedHeaderEntriesFile [secondlife-bin lltexturecache.cpp:1292]
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rw-r--r--indra/newview/lltexturecache.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 7a0712f8aa..0e72b93e48 100644
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -1221,9 +1221,17 @@ U32 LLTextureCache::openAndReadEntries(std::vector<Entry>& entries)
mFreeList.clear();
mTexturesSizeTotal = 0;
- LLAPRFile* aprfile = openHeaderEntriesFile(true, 0);
- updatedHeaderEntriesFile() ;
- aprfile->seek(APR_SET, (S32)sizeof(EntriesInfo));
+ 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;