summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-04-03 21:15:57 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-04-07 21:13:48 +0300
commit3d7de1b39ba23a308900a677b3a368184f5f59a0 (patch)
tree287933280a118e82c3c77cb36d45c3924df445e7 /indra
parent8f6bc554b64c462635f7a02aa6020c1658c5c98c (diff)
#3870 Crash at LLVOAvatarSelf::getJoint()
A long standing one
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoavatar.h2
-rw-r--r--indra/newview/llvoavatarself.cpp9
-rw-r--r--indra/newview/llvoavatarself.h4
3 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 263c3dadf6..a2232d21a2 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -547,7 +547,7 @@ public:
U32 renderTransparent(bool first_pass);
void renderCollisionVolumes();
void renderBones(const std::string &selected_joint = std::string());
- void renderJoints();
+ virtual void renderJoints();
static void deleteCachedImages(bool clearAll=true);
static void destroyGL();
static void restoreGL();
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 746ef7cacb..f23af5afa4 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -697,6 +697,7 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time)
// virtual
LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
{
+ std::lock_guard lock(mJointMapMutex);
LLJoint *jointp = NULL;
jointp = LLVOAvatar::getJoint(name);
if (!jointp && mScreenp)
@@ -714,6 +715,14 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
return jointp;
}
+
+//virtual
+void LLVOAvatarSelf::renderJoints()
+{
+ std::lock_guard lock(mJointMapMutex);
+ LLVOAvatar::renderJoints();
+}
+
// virtual
bool LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight)
{
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 051ac791c0..f9bea41b1d 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -92,6 +92,8 @@ public:
/*virtual*/ void requestStopMotion(LLMotion* motion);
/*virtual*/ LLJoint* getJoint(const std::string &name);
+ /*virtual*/ void renderJoints();
+
/*virtual*/ bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
/*virtual*/ bool setVisualParamWeight(const char* param_name, F32 weight);
/*virtual*/ bool setVisualParamWeight(S32 index, F32 weight);
@@ -103,6 +105,8 @@ private:
// helper function. Passed in param is assumed to be in avatar's parameter list.
bool setParamWeight(const LLViewerVisualParam *param, F32 weight);
+ std::mutex mJointMapMutex; // getJoint gets used from mesh thread
+
/********************************************************************************
** **
** STATE