MAINT-3474 FIXED crash on startup in LLTextureCache::purgeAllTextures(bool) attempting to delete texture cache

master
maksymsproductengine 2013-11-22 20:16:37 +02:00
parent 1ae4d45337
commit 2c5e306e14
1 changed files with 18 additions and 9 deletions

View File

@ -119,16 +119,25 @@ bool LLDirIterator::Impl::next(std::string &fname)
fs::directory_iterator end_itr; // default construction yields past-the-end
bool found = false;
while (mIter != end_itr && !found)
{
boost::smatch match;
std::string name = mIter->path().filename().string();
if (found = boost::regex_match(name, match, mFilterExp))
{
fname = name;
}
++mIter;
// Check if path is a directory.
try
{
while (mIter != end_itr && !found)
{
boost::smatch match;
std::string name = mIter->path().filename().string();
if (found = boost::regex_match(name, match, mFilterExp))
{
fname = name;
}
++mIter;
}
}
catch (const fs::filesystem_error& e)
{
llwarns << e.what() << llendl;
}
return found;