summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2024-08-14 14:04:19 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2024-08-19 12:17:20 +0200
commitee320b22b39c7ecaecb26a04683c6ccbea0deab6 (patch)
tree1177ae8b87f11b07b27f24deb59e5dfe9f058803 /indra
parent8f658804bc34d26457a65e3a1ff4487c19448f64 (diff)
#2289 BugSplat Crash #1496385: SecondLifeViewer!LLFocusableElement::~LLFocusableElement(79)
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lllayoutstack.cpp51
1 files changed, 35 insertions, 16 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 3a3aa7e4df..1c59938f90 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -86,10 +86,6 @@ void LLLayoutPanel::initFromParams(const Params& p)
LLLayoutPanel::~LLLayoutPanel()
{
- // probably not necessary, but...
- delete mResizeBar;
- mResizeBar = NULL;
-
gFocusMgr.removeKeyboardFocusWithoutCallback(this);
}
@@ -242,11 +238,9 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p)
LLLayoutStack::~LLLayoutStack()
{
- e_panel_list_t panels = mPanels; // copy list of panel pointers
- mPanels.clear(); // clear so that removeChild() calls don't cause trouble
- std::for_each(panels.begin(), panels.end(), DeletePointer());
}
+// virtual
void LLLayoutStack::draw()
{
updateLayout();
@@ -284,8 +278,14 @@ void LLLayoutStack::draw()
}
}
+// virtual
void LLLayoutStack::deleteAllChildren()
{
+ for (LLLayoutPanel* p : mPanels)
+ {
+ p->mResizeBar = nullptr;
+ }
+
mPanels.clear();
LLView::deleteAllChildren();
@@ -295,29 +295,47 @@ void LLLayoutStack::deleteAllChildren()
mNeedsLayout = true;
}
+// virtual
void LLLayoutStack::removeChild(LLView* view)
{
- LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast<LLPanel*>(view));
-
- if (embedded_panelp)
+ if (LLLayoutPanel* embedded_panelp = dynamic_cast<LLLayoutPanel*>(view))
{
- mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp));
- LLView::removeChild(view);
- updateFractionalSizes();
- mNeedsLayout = true;
+ auto it = std::find(mPanels.begin(), mPanels.end(), embedded_panelp);
+ if (it != mPanels.end())
+ {
+ mPanels.erase(it);
+ }
+ if (embedded_panelp->mResizeBar)
+ {
+ LLView::removeChild(embedded_panelp->mResizeBar);
+ embedded_panelp->mResizeBar = nullptr;
+ }
}
- else
+ else if (LLResizeBar* resize_bar = dynamic_cast<LLResizeBar*>(view))
{
- LLView::removeChild(view);
+ for (LLLayoutPanel* p : mPanels)
+ {
+ if (p->mResizeBar == resize_bar)
+ {
+ p->mResizeBar = nullptr;
+ }
+ }
}
+
+ LLView::removeChild(view);
+
+ updateFractionalSizes();
+ mNeedsLayout = true;
}
+// virtual
bool LLLayoutStack::postBuild()
{
updateLayout();
return true;
}
+// virtual
bool LLLayoutStack::addChild(LLView* child, S32 tab_group)
{
LLLayoutPanel* panelp = dynamic_cast<LLLayoutPanel*>(child);
@@ -983,6 +1001,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
//normalizeFractionalSizes();
}
+// virtual
void LLLayoutStack::reshape(S32 width, S32 height, bool called_from_parent)
{
mNeedsLayout = true;