diff options
author | RunitaiLinden <davep@lindenlab.com> | 2024-02-08 14:54:01 -0600 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2024-02-08 14:54:01 -0600 |
commit | c721152c444ee7a13e4217f86dfcce34b7488ee5 (patch) | |
tree | 617fd01807d2380322a06a22ad0ede1a3f20c0d5 | |
parent | 97d2b216212b3e106bb9129689e8eb162f9f68f5 (diff) |
Fix for crash in LLHeroProbeManager
-rw-r--r-- | indra/newview/llheroprobemanager.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llheroprobemanager.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index a105fd2fa8..c66054f618 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -126,7 +126,7 @@ void LLHeroProbeManager::update() for (auto vo : mHeroVOList) { - if (vo) + if (vo && !vo->isDead()) { if (vo->mDrawable.notNull()) { @@ -148,7 +148,7 @@ void LLHeroProbeManager::update() } } - if (mNearestHero != nullptr && mNearestHero->mDrawable.notNull()) + if (mNearestHero != nullptr && !mNearestHero->isDead() && mNearestHero->mDrawable.notNull()) { LLVector3 hero_pos = mNearestHero->getPositionAgent(); LLVector3 face_normal = LLVector3(0, 0, 1); @@ -168,6 +168,10 @@ void LLHeroProbeManager::update() probe_pos.load3(point.mV); } + else + { + mNearestHero = nullptr; + } mHeroProbeStrength = 1; } diff --git a/indra/newview/llheroprobemanager.h b/indra/newview/llheroprobemanager.h index 5ec1101b45..9151189a92 100644 --- a/indra/newview/llheroprobemanager.h +++ b/indra/newview/llheroprobemanager.h @@ -137,7 +137,7 @@ private: bool mRenderingMirror = false; bool mHasMirrors = false; - std::set<LLVOVolume*> mHeroVOList; - LLVOVolume* mNearestHero; + std::set<LLPointer<LLVOVolume>> mHeroVOList; + LLPointer<LLVOVolume> mNearestHero; }; |