From 823dbc880540a789c5768930e0dffafd7c4a0269 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Wed, 7 Dec 2022 19:33:12 +0200
Subject: SL-18801 Crash at LLPluginProcessParent::pollTick()

Looks like pollTick tried to call an already dead process
---
 indra/llcommon/llprocess.cpp             | 8 ++++++++
 indra/llplugin/llpluginprocessparent.cpp | 5 +++++
 indra/newview/llviewerobjectlist.cpp     | 5 ++++-
 3 files changed, 17 insertions(+), 1 deletion(-)

(limited to 'indra')

diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index 23936f0526..97a38ea992 100644
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -272,6 +272,14 @@ public:
 					boost::bind(&ReadPipeImpl::tick, this, _1));
 	}
 
+    ~ReadPipeImpl()
+    {
+        if (mConnection.connected())
+        {
+            mConnection.disconnect();
+        }
+    }
+
 	// Much of the implementation is simply connecting the abstract virtual
 	// methods with implementation data concealed from the base class.
 	virtual std::istream& get_istream() { return mStream; }
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index 1fbbad06d4..756d0b5db8 100644
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -162,6 +162,11 @@ LLPluginProcessParent::~LLPluginProcessParent()
     {   // If we are quitting, the network sockets will already have been destroyed.
         killSockets();
     }
+
+    if (mPolling.connected())
+    {
+        mPolling.disconnect();
+    }
 }
 
 /*static*/
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index e930b58111..efc4ded79e 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -815,7 +815,10 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
 	{
 		virtual bool apply(LLViewerObject* objectp)
 		{
-			objectp->boostTexturePriority();
+            if (objectp)
+            {
+                objectp->boostTexturePriority();
+            }
 			return true;
 		}
 	} func;
-- 
cgit v1.2.3