From e360423598002893f5735b9898a565c8d159d1f8 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Thu, 14 Sep 2017 22:36:16 +0100
Subject: [PATCH] SL-789 - fix for llassert_always() crash in updateImpostors()

---
 indra/newview/llvoavatar.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index ac8b133bb70..4664eeffc4d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -9029,10 +9029,10 @@ U32 LLVOAvatar::getPartitionType() const
 void LLVOAvatar::updateImpostors()
 {
 	LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
-	LLCharacter::sAllowInstancesChange = FALSE;
 
-	for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
-		iter != LLCharacter::sInstances.end(); ++iter)
+    std::vector<LLCharacter*> instances_copy = LLCharacter::sInstances;
+	for (std::vector<LLCharacter*>::iterator iter = instances_copy.begin();
+		iter != instances_copy.end(); ++iter)
 	{
 		LLVOAvatar* avatar = (LLVOAvatar*) *iter;
 		if (!avatar->isDead() && avatar->isVisible()
-- 
GitLab