From 0e0ba2fd866e6f6f3b89008dbe7d3a8e0c826ff5 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Sat, 22 Aug 2020 00:37:23 +0300
Subject: [PATCH] SL-13830 One more coroutine crash

---
 indra/newview/llvoicevivox.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 42a1cf95a77..970570b1355 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -411,6 +411,7 @@ void LLVivoxVoiceClient::terminate()
 	}
 	else
 	{
+		mRelogRequested = false;
 		killGateway();
 	}
 }
@@ -660,12 +661,18 @@ void LLVivoxVoiceClient::voiceControlCoro()
 
     U32 retry = 0;
 
-    while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
+    while (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE && !LLApp::isExiting())
     {
         LL_DEBUGS("Voice") << "Suspending voiceControlCoro() momentarily for teleport. Tuning: " << mTuningMode << ". Relog: " << mRelogRequested << LL_ENDL;
         llcoro::suspendUntilTimeout(1.0);
     }
 
+    if (LLApp::isExiting())
+    {
+        mIsCoroutineActive = false;
+        return;
+    }
+
     do
     {
         bool success = startAndConnectSession();
-- 
GitLab