From 85e03a7ad749a702a48da4a6a6d6997c433e8eaa Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Sat, 22 Aug 2020 10:29:33 +0300
Subject: [PATCH] SL-13830 One more coroutine exit crash

LLWorld is supposed to first remove region from list, then delete the region, but in case of this crash region was returned by handle from llworld yet was mDead and cleaned up, all in main thread.
---
 indra/newview/llviewerregion.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 2ca045b0c90..b9cf4b07dcd 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -298,6 +298,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
 
         ++mSeedCapAttempts;
 
+        if (LLApp::isExiting())
+        {
+            return;
+        }
+
         regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
         if (!regionp) //region was removed
         {
@@ -412,6 +417,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
             break;  // no retry
         }
 
+        if (LLApp::isExiting())
+        {
+            break;
+        }
+
         regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
         if (!regionp) //region was removed
         {
@@ -515,6 +525,11 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
             continue;  
         }
 
+        if (LLApp::isExiting())
+        {
+            break;
+        }
+
         // remove the http_result from the llsd
         result.erase("http_result");
 
-- 
GitLab