SL-20469 Crash at dead mRootVolp in getAttachedAvatar()

master
Andrey Kleshchev 2024-02-21 00:31:08 +02:00 committed by Andrey Kleshchev
parent 54dfcd7502
commit 5e697cc04c
2 changed files with 10 additions and 2 deletions

View File

@ -99,7 +99,6 @@ LLVOAvatar *LLControlAvatar::getAttachedAvatar()
void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const
{
F32 max_legal_offset = MAX_LEGAL_OFFSET;
if (gSavedSettings.getControl("AnimatedObjectsMaxLegalOffset"))
{
@ -362,6 +361,9 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj)
void LLControlAvatar::markForDeath()
{
mMarkedForDeath = true;
// object unlinked cav and might be dead already
// might need to clean mControlAVBridge here as well
mRootVolp = NULL;
}
void LLControlAvatar::idleUpdate(LLAgent &agent, const F64 &time)
@ -440,7 +442,7 @@ void LLControlAvatar::updateDebugText()
F32 streaming_cost = 0.f;
std::string cam_dist_string = "";
S32 cam_dist_count = 0;
F32 lod_radius = mRootVolp->mLODRadius;
F32 lod_radius = mRootVolp ? mRootVolp->mLODRadius : 0.f;
for (std::vector<LLVOVolume*>::iterator it = volumes.begin();
it != volumes.end(); ++it)

View File

@ -392,6 +392,12 @@ LLViewerObject::~LLViewerObject()
sNumZombieObjects--;
llassert(mChildList.size() == 0);
llassert(mControlAvatar.isNull()); // Should have been cleaned by now
if (mControlAvatar.notNull())
{
mControlAvatar->markForDeath();
mControlAvatar = NULL;
LL_WARNS() << "Dead object owned a live control avatar" << LL_ENDL;
}
clearInventoryListeners();
}