From 4316f1d322bc8e0439780d68442d76b17927247c Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 8 Jan 2019 21:28:47 +0000
Subject: [PATCH] SL-10285 - removed one possible route for the isImpostor()
 crash. Intermittent issue.

---
 indra/newview/llcontrolavatar.cpp | 2 ++
 indra/newview/llviewerobject.cpp  | 1 +
 2 files changed, 3 insertions(+)

diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index d3fd5813a03..0f02c23cb04 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -60,6 +60,8 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer
 // virtual
 LLControlAvatar::~LLControlAvatar()
 {
+	// Should already have been unlinked before destruction
+	llassert(!mRootVolp);
 }
 
 // virtual
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 007adf2a72b..ec1095813bf 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -3100,6 +3100,7 @@ void LLViewerObject::unlinkControlAvatar()
         if (mControlAvatar)
         {
             mControlAvatar->markForDeath();
+			mControlAvatar->mRootVolp = NULL;
             mControlAvatar = NULL;
         }
     }
-- 
GitLab