From 75455d101c9535d0d45aa0f505f888f4ba3de64d Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 6 Aug 2024 09:21:19 -0400 Subject: Convert LLUI and LLRender2D to LLSimpleton to reduce overhead during ui draw (#2202) --- indra/llui/llfocusmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llfocusmgr.cpp') diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 937dde4def..c635d24f51 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -183,7 +183,7 @@ void LLFocusMgr::releaseFocusIfNeeded( LLView* view ) } } - LLUI::getInstance()->removePopup(view); + if(LLUI::instanceExists()) LLUI::getInstance()->removePopup(view); } void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, bool lock, bool keystrokes_only) @@ -481,7 +481,7 @@ void LLFocusMgr::setAppHasFocus(bool focus) // release focus from "top ctrl"s, which generally hides them if (!focus) { - LLUI::getInstance()->clearPopups(); + if(LLUI::instanceExists()) LLUI::getInstance()->clearPopups(); } mAppHasFocus = focus; } -- cgit v1.2.3 From 3cd1500801dfb0fba4a00a7162148fc8a60a1726 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 13 Aug 2024 14:52:50 +0200 Subject: #2271 BugSplat Crash #1504299: LLFocusableElement::~LLFocusableElement(79) --- indra/llui/llfocusmgr.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'indra/llui/llfocusmgr.cpp') diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index c635d24f51..0d7c98294f 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -73,10 +73,20 @@ bool LLFocusableElement::wantsReturnKey() const // virtual LLFocusableElement::~LLFocusableElement() { - delete mFocusLostCallback; - delete mFocusReceivedCallback; - delete mFocusChangedCallback; - delete mTopLostCallback; + auto free_signal = [&](focus_signal_t*& signal) + { + if (signal) + { + signal->disconnect_all_slots(); + delete signal; + signal = nullptr; + } + }; + + free_signal(mFocusLostCallback); + free_signal(mFocusReceivedCallback); + free_signal(mFocusChangedCallback); + free_signal(mTopLostCallback); } void LLFocusableElement::onFocusReceived() -- cgit v1.2.3