From b7ad7ccaaa4f4ea5947e844ce87c13a8899f0aa1 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Thu, 19 Oct 2023 23:54:28 +0300
Subject: [PATCH] SL-20506 Crash when recreating LLViewerParcelMedia

---
 indra/newview/llenvironment.cpp     | 2 +-
 indra/newview/llviewerparcelmgr.cpp | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 05c7decfbda..c562a5f5124 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -2061,7 +2061,7 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ
     {
         LL_WARNS("ENVIRONMENT") << "Couldn't retrieve environment settings for " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL;
     }
-    else if (LLApp::isExiting())
+    else if (LLApp::isExiting() || gDisconnected)
     {
         return;
     }
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 15accd05479..c5426c93828 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1526,6 +1526,12 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
 // static
 void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **user)
 {
+    if (LLApp::isExiting() || gDisconnected)
+    {
+        LL_DEBUGS("ParcelMgr") << "Ignoring parcel properties, shutting down" << LL_ENDL;
+        return;
+    }
+
     S32		request_result;
     S32		sequence_id;
     BOOL	snap_selection = FALSE;
-- 
GitLab