summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-09-04 19:20:52 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-09-04 19:20:52 +0300
commit27d391b2bb068ee38ba36e7b3169058196da9420 (patch)
tree2c9a7e7ec92b57e3c2c2905f3ae3f09004452a99 /indra/newview
parenta8bc48b334428ab0d809c93d3d70b8a84df6723e (diff)
SL-11868 Fix cache init after purge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp5
-rw-r--r--indra/newview/llvocache.cpp3
-rw-r--r--indra/newview/llvocache.h6
3 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 1874743644..f414ec0d09 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4123,7 +4123,7 @@ bool LLAppViewer::initCache()
mPurgeCache = false;
BOOL read_only = mSecondInstance ? TRUE : FALSE;
LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
- LLVOCache::initParamSingleton(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion(), read_only);
+ LLVOCache::initParamSingleton(read_only);
bool texture_cache_mismatch = false;
if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion())
@@ -4195,6 +4195,9 @@ bool LLAppViewer::initCache()
S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch);
texture_cache_size -= extra;
+
+ LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion());
+
LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS"));
// Init the VFS
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 0e6511f6b5..07660ca6ac 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -1045,7 +1045,7 @@ const char* object_cache_dirname = "objectcache";
const char* header_filename = "object.cache";
-LLVOCache::LLVOCache(ELLPath location, U32 size, U32 cache_version, bool read_only) :
+LLVOCache::LLVOCache(bool read_only) :
mInitialized(false),
mReadOnly(read_only),
mNumEntries(0),
@@ -1053,7 +1053,6 @@ LLVOCache::LLVOCache(ELLPath location, U32 size, U32 cache_version, bool read_on
{
mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled");
mLocalAPRFilePoolp = new LLVolatileAPRPool() ;
- initCache(location, size, cache_version);
}
LLVOCache::~LLVOCache()
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 41b5246480..6c95541c11 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -223,7 +223,7 @@ private:
//
class LLVOCache : public LLParamSingleton<LLVOCache>
{
- LLSINGLETON(LLVOCache, ELLPath location, U32 size, U32 cache_version, bool read_only);
+ LLSINGLETON(LLVOCache, bool read_only);
~LLVOCache() ;
private:
@@ -259,6 +259,8 @@ private:
typedef std::map<U64, HeaderEntryInfo*> handle_entry_map_t;
public:
+ // We need this init to be separate from constructor, since we might construct cache, purge it, then init.
+ void initCache(ELLPath location, U32 size, U32 cache_version);
void removeCache(ELLPath location, bool started = false) ;
void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ;
@@ -269,8 +271,6 @@ public:
U32 getCacheEntriesMax() { return mCacheSize; }
private:
- void initCache(ELLPath location, U32 size, U32 cache_version);
-
void setDirNames(ELLPath location);
// determine the cache filename for the region from the region handle
void getObjectCacheFilename(U64 handle, std::string& filename);