summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2024-08-13 14:52:50 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2024-08-13 20:21:21 +0200
commit3cd1500801dfb0fba4a00a7162148fc8a60a1726 (patch)
tree3d2f6b88efa6dee3f624ee4e9d666c7a674ff90b /indra/llui
parent2cc21e982668750b237edf2c54979f58d1c52203 (diff)
#2271 BugSplat Crash #1504299: LLFocusableElement::~LLFocusableElement(79)
Diffstat (limited to 'indra/llui')
-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()