From 689ef9442581d7af8ff0e0264be4919fe6cffd73 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 22 Mar 2024 23:04:56 +0200 Subject: viewer#1033 Crash at syncFloaterTabOrder --- indra/llui/llfloater.cpp | 22 ++++++++++++---------- indra/llui/llfloater.h | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index fb90cebd39..cf33d633ad 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2406,8 +2406,7 @@ LLFloaterView::LLFloaterView (const Params& p) mFocusCycleMode(FALSE), mMinimizePositionVOffset(0), mSnapOffsetBottom(0), - mSnapOffsetRight(0), - mFrontChild(NULL) + mSnapOffsetRight(0) { mSnapView = getHandle(); } @@ -2563,7 +2562,8 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore if (!child) return; - if (mFrontChild == child) + LLFloater* front_child = mFrontChildHandle.get(); + if (front_child == child) { if (give_focus && child->canFocusStealFrontmost() && !gFocusMgr.childHasKeyboardFocus(child)) { @@ -2572,12 +2572,12 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore return; } - if (mFrontChild && !mFrontChild->isDead() && mFrontChild->getVisible()) + if (front_child && front_child->getVisible()) { - mFrontChild->goneFromFront(); + front_child->goneFromFront(); } - mFrontChild = child; + mFrontChildHandle = child->getHandle(); // *TODO: make this respect floater's mAutoFocus value, instead of // using parameter @@ -3076,7 +3076,8 @@ LLFloater *LLFloaterView::getBackmost() const void LLFloaterView::syncFloaterTabOrder() { - if (mFrontChild && !mFrontChild->isDead() && mFrontChild->getIsChrome()) + LLFloater* front_child = mFrontChildHandle.get(); + if (front_child && front_child->getIsChrome()) return; // look for a visible modal dialog, starting from first @@ -3114,11 +3115,12 @@ void LLFloaterView::syncFloaterTabOrder() LLFloater* floaterp = dynamic_cast(*child_it); if (gFocusMgr.childHasKeyboardFocus(floaterp)) { - if (mFrontChild != floaterp) + LLFloater* front_child = mFrontChildHandle.get(); + if (front_child != floaterp) { // Grab a list of the top floaters that want to stay on top of the focused floater std::list listTop; - if (mFrontChild && !mFrontChild->canFocusStealFrontmost()) + if (front_child && !front_child->canFocusStealFrontmost()) { for (LLView* childp : *getChildList()) { @@ -3138,7 +3140,7 @@ void LLFloaterView::syncFloaterTabOrder() { sendChildToFront(childp); } - mFrontChild = listTop.back(); + mFrontChildHandle = listTop.back()->getHandle(); } } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 5f4e1a2cad..39957386df 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -622,7 +622,7 @@ private: S32 mMinimizePositionVOffset; typedef std::vector, boost::signals2::connection> > hidden_floaters_t; hidden_floaters_t mHiddenFloaters; - LLFloater * mFrontChild; + LLHandle mFrontChildHandle; }; // -- cgit v1.2.3