From 37d7f469055d3ba4b81815fa2ac8459022e1e3cf Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 15 Nov 2012 15:32:02 -0800 Subject: CHUI-524: The root reason of crash was in the infinity recursion in the chain of calls LLFloater::setFocus->LLFloater::setFrontmost->LLFloaterView::bringToFront. And problem was not related to CHUI-362. Reviewed by Stinson. --- indra/llui/llfloater.cpp | 10 +++++++++- indra/llui/llfloater.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 0e57ba02bf..1b6e4ed0e5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2234,7 +2234,8 @@ LLFloaterView::LLFloaterView (const Params& p) mFocusCycleMode(FALSE), mMinimizePositionVOffset(0), mSnapOffsetBottom(0), - mSnapOffsetRight(0) + mSnapOffsetRight(0), + mFrontChild(NULL) { mSnapView = getHandle(); } @@ -2383,6 +2384,13 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) { + if (mFrontChild == child) + { + return; + } + + mFrontChild = child; + // *TODO: make this respect floater's mAutoFocus value, instead of // using parameter if (child->getHost()) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 07b79d5523..ca0710cdc1 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -576,6 +576,7 @@ private: S32 mMinimizePositionVOffset; typedef std::vector, boost::signals2::connection> > hidden_floaters_t; hidden_floaters_t mHiddenFloaters; + LLFloater * mFrontChild; }; // -- cgit v1.2.3