diff options
author | Ansariel Hiller <ansarielhiller@yahoo.de> | 2021-05-11 19:59:21 +0000 |
---|---|---|
committer | Callum Linden <callum@lindenlab.com> | 2021-05-11 19:59:21 +0000 |
commit | 1ec6c10c140131dc3e71eb4b90a6fbcf2f4ec61e (patch) | |
tree | a1a321801f9641682fe062cbeda46213d67f6468 | |
parent | 99b99a1b4a21758ef888b251d8f8bbf565f8b42e (diff) | |
parent | 8633ba9c8bd8e24f9b6d8a74ed7bc4d50072a728 (diff) |
Merged in DRTVWR-519 (pull request #567)
BUG-230697: Do not crash viewer during cache cleanup
Approved-by: Callum Linden
-rw-r--r-- | indra/llfilesystem/lldiskcache.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index c9f7684b5a..75255ef230 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -102,7 +102,12 @@ void LLDiskCache::purge() if (file_size_total > mMaxSizeBytes) { action = "DELETE:"; - boost::filesystem::remove(entry.second.second); + boost::system::error_code ec; + boost::filesystem::remove(entry.second.second, ec); + if (ec.failed()) + { + LL_WARNS() << "Failed to delete cache file " << entry.second.second << ": " << ec.message() << LL_ENDL; + } } else { @@ -284,7 +289,12 @@ void LLDiskCache::clearCache() { if (entry.path().string().find(mCacheFilenamePrefix) != std::string::npos) { - boost::filesystem::remove(entry); + boost::system::error_code ec; + boost::filesystem::remove(entry, ec); + if (ec.failed()) + { + LL_WARNS() << "Failed to delete cache file " << entry << ": " << ec.message() << LL_ENDL; + } } } } |