From 3cd27c658a4aa94f68cd2f5c96e638a28d2c4297 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 21 Jul 2026 17:36:59 +0300 Subject: #6014 Inventory cache tweaks --- indra/newview/llappviewer.cpp | 6 +++--- indra/newview/llinventorymodel.cpp | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0224f1613b..5a1a4b8258 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1749,15 +1749,15 @@ bool LLAppViewer::cleanup() // Give any remaining SLPlugin instances a chance to exit cleanly. LLPluginProcessParent::shutdown(); - disconnectViewer(); - if (LLWatchdog::instanceExists()) { // Signal a stop early, so that it will be out - // of sleep loop by the time we get to clean it. + // of 1s sleep loop by the time we get to clean it. LLWatchdog::getInstance()->shutdown(); } + disconnectViewer(); + LLViewerCamera::deleteSingleton(); LL_INFOS() << "Viewer disconnected" << LL_ENDL; diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 9a1cc3b122..dbcade88c2 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2485,28 +2485,28 @@ void LLInventoryModel::cache( void LLInventoryModel::waitForPendingCacheWrites() { + if (sPendingCacheThreads.empty()) + { + return; + } LL_PROFILE_ZONE_SCOPED; // By this point all threads should have already been added, // viewer is shutting down, main thread is the only one to // modify sPendingCacheThreads - if (!sPendingCacheThreads.empty()) - { - LL_DEBUGS(LOG_INV) << "Waiting for " << sPendingCacheThreads.size() - << " inventory cache compression thread(s) to complete..." << LL_ENDL; - - LLTimer wait_timer; + LL_DEBUGS(LOG_INV) << "Waiting for " << sPendingCacheThreads.size() + << " inventory cache compression thread(s) to complete..." << LL_ENDL; - for (auto& thread : sPendingCacheThreads) + for (auto& thread : sPendingCacheThreads) + { + if (thread.joinable()) { - if (thread.joinable()) - { - thread.join(); - } + thread.join(); } - - LL_INFOS(LOG_INV) << "Inventory cache compression completed" << LL_ENDL; } + sPendingCacheThreads.clear(); + + LL_INFOS(LOG_INV) << "Inventory cache compression completed" << LL_ENDL; } void LLInventoryModel::addCategory(LLViewerInventoryCategory* category) -- cgit v1.3