From 2a31aec53445749310d8fea1ecc88e6e4e14f8d1 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 21 Dec 2022 00:26:03 -0500
Subject: [PATCH] Cleanup

---
 indra/newview/llviewermenu.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 37075fad8c1..6aa483d47ca 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7542,12 +7542,10 @@ BOOL enable_detach(const LLSD&)
 {
 	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
 	
-	LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection();
-
 	// Only enable detach if all faces of object are selected
 	if (!object ||
 		!object->isAttachment() ||
-		!hSelect->contains(object,SELECT_ALL_TES ))
+		!LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES ))
 	{
 		return FALSE;
 	}
@@ -7567,6 +7565,7 @@ BOOL enable_detach(const LLSD&)
 			//                          SEND_ONLY_ROOTS so we only need to examine the roots which saves us time
 			if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_REMOVE)) )
 			{
+				LLObjectSelectionHandle hSelect = LLSelectMgr::getInstance()->getSelection();
 				RlvSelectHasLockedAttach f;
 				if ( (hSelect->isAttachment()) && (hSelect->getFirstRootNode(&f, FALSE) != NULL) )
 					return FALSE;
-- 
GitLab