diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-09-21 03:29:46 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-09-21 03:35:22 +0300 |
commit | c2b2598c046e65cb9e003a851d449a3a017e6ac1 (patch) | |
tree | 09703367dc78f2900eada81b93d4694827977ba4 | |
parent | d72b43f1a90d271ac6d0b0a398a6f906afb3468c (diff) |
SL-20319 Crash at removeMutedAVsLights
Merge conflict? This was fixed in SL-17752 but somehow reverted without
a commit
-rw-r--r-- | indra/newview/pipeline.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bbff6c889f..f01a015713 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1778,17 +1778,23 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable) void LLPipeline::removeMutedAVsLights(LLVOAvatar* muted_avatar) { LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; - for (light_set_t::iterator iter = gPipeline.mNearbyLights.begin(); - iter != gPipeline.mNearbyLights.end(); iter++) - { - const LLViewerObject *vobj = iter->drawable->getVObj(); - if (vobj && vobj->getAvatar() - && vobj->isAttachment() && vobj->getAvatar() == muted_avatar) - { - gPipeline.mLights.erase(iter->drawable); - gPipeline.mNearbyLights.erase(iter); - } - } + light_set_t::iterator iter = gPipeline.mNearbyLights.begin(); + while (iter != gPipeline.mNearbyLights.end()) + { + const LLViewerObject* vobj = iter->drawable->getVObj(); + if (vobj + && vobj->getAvatar() + && vobj->isAttachment() + && vobj->getAvatar() == muted_avatar) + { + gPipeline.mLights.erase(iter->drawable); + iter = gPipeline.mNearbyLights.erase(iter); + } + else + { + iter++; + } + } } U32 LLPipeline::addObject(LLViewerObject *vobj) |