diff options
author | Rye Mutt <rye@lindenlab.com> | 2024-10-01 19:01:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-01 16:01:36 -0700 |
commit | 01af537af1529ffb8d59cdffb061488bd3f64daf (patch) | |
tree | 11f5221959f3ac3f4d35fa3120540884412083bd /indra/newview | |
parent | 002a81ccf5a64fd08e29811a6edea36f2e0408be (diff) |
Fix thread-unsafe usage of LLPointer and LLMeshSkinInfo(#2755) (#2759)
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a8585c7f23..5fc49b32ea 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -864,7 +864,7 @@ LLMeshRepoThread::~LLMeshRepoThread() while (!mSkinInfoQ.empty()) { - delete mSkinInfoQ.front(); + llassert(mSkinInfoQ.front()->getNumRefs() == 1); mSkinInfoQ.pop_front(); } @@ -2058,13 +2058,15 @@ bool LLMeshRepoThread::skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 dat LLSkinningUtil::initJointNums(info, gAgentAvatarp); } - // remember the skin info in the background thread so we can use it + // copy the skin info for the background thread so we can use it // to calculate per-joint bounding boxes when volumes are loaded - mSkinMap[mesh_id] = info; + mSkinMap[mesh_id] = new LLMeshSkinInfo(*info); { + // Move the LLPointer in to the skin info queue to avoid reference + // count modification after we leave the lock LLMutexLock lock(mMutex); - mSkinInfoQ.push_back(info); + mSkinInfoQ.emplace_back(std::move(info)); } } |