summaryrefslogtreecommitdiff
path: root/indra/llui/llfocusmgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-08-20 06:29:21 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-08-20 06:29:21 +0300
commit3a4720d1f523ca8ebee0d963604c236c08980eae (patch)
treeff5c6adb045d104aa3cce6c6c68e63e3c55659cb /indra/llui/llfocusmgr.cpp
parent34c13264f33d9bbfc73302b84c8fade1b115fb93 (diff)
parent169599fd2f211d66f80a54e13daf975229607022 (diff)
Merge branch 'develop' into marchcat/b-develop
# Conflicts: # .github/workflows/build.yaml # autobuild.xml # indra/cmake/Copy3rdPartyLibs.cmake # indra/cmake/FreeType.cmake # indra/newview/llappviewer.cpp # indra/newview/skins/default/xui/en/floater_fast_timers.xml # indra/newview/viewer_manifest.py # indra/test/test.cpp
Diffstat (limited to 'indra/llui/llfocusmgr.cpp')
-rw-r--r--indra/llui/llfocusmgr.cpp18
1 files changed, 14 insertions, 4 deletions
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()