summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 19:48:36 +0300
committerGitHub <noreply@github.com>2024-04-24 19:48:36 +0300
commit3c833ce035c87e0f03ec8e46894d10adb33ad820 (patch)
treef2ee6c215244bdea45440b1a753c83d19eace121 /indra/newview/llvoavatarself.cpp
parentea4ddb5f40ee8dd253be0ac4229de90f1eef61a3 (diff)
parent3713c33098ab98d840c0ed20bcbb5a1cb8e15235 (diff)
Merge pull request #1314 from secondlife/marchcat/b-merge
Release (Maint YZ) -> Maint B merge
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 7b24b9ee02..f12fc3babc 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -834,7 +834,11 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
for (AnimSourceIterator motion_it = mAnimationSources.find(source_id); motion_it != mAnimationSources.end(); )
{
gAgent.sendAnimationRequest(motion_it->second, ANIM_REQUEST_STOP);
- mAnimationSources.erase(motion_it++);
+ mAnimationSources.erase(motion_it);
+ // Must find() after each erase() to deal with potential iterator invalidation
+ // This also ensures that we don't go past the end of this source's animations
+ // into those of another source.
+ motion_it = mAnimationSources.find(source_id);
}