diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-04-19 21:14:33 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-04-19 21:14:33 +0800 |
commit | 9595a3dee48eb8b7f10cad02b4ebdda5f596664e (patch) | |
tree | aadbfc379b2028e1f22662d38b1094c745064ad9 /indra/newview/llmeshrepository.cpp | |
parent | ad9c801edb13568657c0964ebfb74257da6d9e00 (diff) | |
parent | 9a333e65c4019540d5675e72ac57ef5ab106aab0 (diff) |
Merge tag 'Second_Life_Release#9a333e65-2025.04' into 2025.04
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a8c6f69425..48c80842b9 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1210,6 +1210,12 @@ void LLMeshRepoThread::run() LL_WARNS(LOG_MESH) << "Convex decomposition unable to be quit." << LL_ENDL; } } +void LLMeshRepoThread::cleanup() +{ + mShuttingDown = true; + mSignal->broadcast(); + mMeshThreadPool->close(); +} // Mutex: LLMeshRepoThread::mMutex must be held on entry void LLMeshRepoThread::loadMeshSkinInfo(const LLUUID& mesh_id) @@ -1493,6 +1499,11 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) [mesh_id, buffer, size] () { + if (gMeshRepo.mThread->isShuttingDown()) + { + delete[] buffer; + return; + } if (!gMeshRepo.mThread->skinInfoReceived(mesh_id, buffer, size)) { // either header is faulty or something else overwrote the cache @@ -1993,6 +2004,11 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod) [params, mesh_id, lod, buffer, size] () { + if (gMeshRepo.mThread->isShuttingDown()) + { + delete[] buffer; + return; + } if (gMeshRepo.mThread->lodReceived(params, lod, buffer, size) == MESH_OK) { LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the cache." << LL_ENDL; @@ -3792,6 +3808,11 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body [shrd_handler, data, data_size] () { + if (gMeshRepo.mThread->isShuttingDown()) + { + delete[] data; + return; + } LLMeshLODHandler* handler = (LLMeshLODHandler * )shrd_handler.get(); handler->processLod(data, data_size); delete[] data; @@ -3905,6 +3926,11 @@ void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /* [shrd_handler, data, data_size] () { + if (gMeshRepo.mThread->isShuttingDown()) + { + delete[] data; + return; + } LLMeshSkinInfoHandler* handler = (LLMeshSkinInfoHandler*)shrd_handler.get(); handler->processSkin(data, data_size); delete[] data; @@ -4127,8 +4153,7 @@ void LLMeshRepository::shutdown() mUploads[i]->discard() ; //discard the uploading requests. } - mThread->mSignal->broadcast(); - mThread->mMeshThreadPool->close(); + mThread->cleanup(); while (!mThread->isStopped()) { |