Avoid crash if main cache directory does not exist.

meow-7.2.2
Tonya Souther 2013-07-19 10:33:17 -05:00
parent 1cfe6a68cf
commit 37e7b276db
2 changed files with 7 additions and 0 deletions

View File

@ -922,6 +922,7 @@ void LLTextureCache::setDirNames(ELLPath location)
{
std::string delem = gDirUtilp->getDirDelimiter();
mCacheParentDirName = gDirUtilp->getExpandedFilename(location,"");
mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, entries_filename);
mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, cache_filename);
mTexturesDirName = gDirUtilp->getExpandedFilename(location, textures_dirname);
@ -998,6 +999,10 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache
if (!mReadOnly)
{
if (!LLFile::isdir(mCacheParentDirName))
{
LLFile::mkdir(mCacheParentDirName);
}
LLFile::mkdir(mTexturesDirName);
const char* subdirs = "0123456789abcdef";

View File

@ -201,6 +201,8 @@ private:
responder_list_t mCompletedList;
BOOL mReadOnly;
std::string mCacheParentDirName;
// HEADERS (Include first mip)
std::string mHeaderEntriesFileName;