diff options
-rw-r--r-- | indra/newview/llappviewer.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llvocache.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llvocache.h | 6 |
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); |