Skip to content

Commit 5e697cc

Browse files
committed
SL-20469 Crash at dead mRootVolp in getAttachedAvatar()
1 parent 54dfcd7 commit 5e697cc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

indra/newview/llcontrolavatar.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ LLVOAvatar *LLControlAvatar::getAttachedAvatar()
9999

100100
void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const
101101
{
102-
103102
F32 max_legal_offset = MAX_LEGAL_OFFSET;
104103
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalOffset"))
105104
{
@@ -362,6 +361,9 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj)
362361
void LLControlAvatar::markForDeath()
363362
{
364363
mMarkedForDeath = true;
364+
// object unlinked cav and might be dead already
365+
// might need to clean mControlAVBridge here as well
366+
mRootVolp = NULL;
365367
}
366368

367369
void LLControlAvatar::idleUpdate(LLAgent &agent, const F64 &time)
@@ -440,7 +442,7 @@ void LLControlAvatar::updateDebugText()
440442
F32 streaming_cost = 0.f;
441443
std::string cam_dist_string = "";
442444
S32 cam_dist_count = 0;
443-
F32 lod_radius = mRootVolp->mLODRadius;
445+
F32 lod_radius = mRootVolp ? mRootVolp->mLODRadius : 0.f;
444446

445447
for (std::vector<LLVOVolume*>::iterator it = volumes.begin();
446448
it != volumes.end(); ++it)

indra/newview/llviewerobject.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,12 @@ LLViewerObject::~LLViewerObject()
392392
sNumZombieObjects--;
393393
llassert(mChildList.size() == 0);
394394
llassert(mControlAvatar.isNull()); // Should have been cleaned by now
395+
if (mControlAvatar.notNull())
396+
{
397+
mControlAvatar->markForDeath();
398+
mControlAvatar = NULL;
399+
LL_WARNS() << "Dead object owned a live control avatar" << LL_ENDL;
400+
}
395401

396402
clearInventoryListeners();
397403
}

0 commit comments

Comments
 (0)