diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2026-05-19 18:51:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-19 18:51:02 -0400 |
| commit | 6d4c4c029ce43aa413266135829cd2bc00001890 (patch) | |
| tree | 209ae880aba5ac777d524bdc557ed166b466347f /indra/llfilesystem/lldiskcache.cpp | |
| parent | 5c500ccf407f0b5a0b253b98dd4bd3f33f643aba (diff) | |
| parent | 115686ca0f962da9ec5dbcdbe54a4cb6c86302bb (diff) | |
Merge pull request #5369 from secondlife/release/2026.02
Release/2026.02
Diffstat (limited to 'indra/llfilesystem/lldiskcache.cpp')
| -rw-r--r-- | indra/llfilesystem/lldiskcache.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index e971e1885a..dd7d1a043f 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -91,6 +91,8 @@ LLDiskCache::LLDiskCache(const std::string& cache_dir, // asset will have to be re-requested. void LLDiskCache::purge() { + LL_PROFILE_ZONE_SCOPED; + if (mEnableCacheDebugInfo) { LL_INFOS() << "Total dir size before purge is " << dirFileSize(sCacheDir) << LL_ENDL; @@ -112,6 +114,10 @@ void LLDiskCache::purge() boost::filesystem::directory_iterator iter(cache_path, ec); while (iter != boost::filesystem::directory_iterator() && !ec.failed()) { + if(!LLApp::isRunning()) + { + return; + } if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) @@ -150,6 +156,10 @@ void LLDiskCache::purge() uintmax_t file_size_total = 0; for (file_info_t& entry : file_info) { + if (!LLApp::isRunning()) + { + return; + } file_size_total += entry.second.first; bool should_remove = file_size_total > mMaxSizeBytes; @@ -176,6 +186,10 @@ void LLDiskCache::purge() // Logging thousands of file results can take hundreds of milliseconds for (size_t i = 0; i < file_info.size(); ++i) { + if (!LLApp::isRunning()) + { + return; + } const file_info_t& entry = file_info[i]; const bool removed = file_removed[i]; const std::string action = removed ? "DELETE:" : "KEEP:"; |
