From c64bd7d5cb28fc221716e866ff9c9a28c22e69ce Mon Sep 17 00:00:00 2001
From: Leslie Linden <leslie@lindenlab.com>
Date: Wed, 7 Sep 2011 12:46:37 -0700
Subject: [PATCH] Reduced text spam on exit by not trying to set all objects to
 a NULL region.

Reviewed by Richard.
---
 indra/newview/llviewerobjectlist.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index db5684665b5..153a91e7d87 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1254,7 +1254,8 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
 BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
 {
 	// Don't ever kill gAgentAvatarp, just force it to the agent's region
-	if (objectp == gAgentAvatarp)
+	// unless region is NULL which is assumed to mean you are logging out.
+	if ((objectp == gAgentAvatarp) && gAgent.getRegion())
 	{
 		objectp->setRegion(gAgent.getRegion());
 		return FALSE;
@@ -1277,6 +1278,7 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
 
 		return TRUE;
 	}
+
 	return FALSE;
 }
 
-- 
GitLab