summaryrefslogtreecommitdiff
path: root/indra/llui/llview.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-02-07 13:11:39 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-02-07 13:11:39 -0500
commit3bcd4f4608a7ce33b61c6978544096436dea4e53 (patch)
tree6ef7168a6ec646c023d2f4badc9a0960d20eea3e /indra/llui/llview.cpp
parent33a42b32ca72031a79edca821966f6ebbdcddc93 (diff)
parent5e367f0d9de593c45683f7c640024a378bb03919 (diff)
Merge daggy fix at r32811ea374ab to tip
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r--indra/llui/llview.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 486babb0ab..e1ee0a5b14 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -121,6 +121,7 @@ LLView::Params::Params()
LLView::LLView(const LLView::Params& p)
: mVisible(p.visible),
+ mInDraw(false),
mName(p.name),
mParentView(NULL),
mReshapeFlags(FOLLOWS_NONE),
@@ -333,6 +334,8 @@ void LLView::removeChild(LLView* child)
//llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs
if (child->mParentView == this)
{
+ // if we are removing an item we are currently iterating over, that would be bad
+ llassert(child->mInDraw == false);
mChildList.remove( child );
child->mParentView = NULL;
if (child->isCtrl())
@@ -1090,6 +1093,11 @@ void LLView::drawChildren()
{
child_list_reverse_iter_t child = child_iter++;
LLView *viewp = *child;
+
+ if (viewp == NULL)
+ {
+ continue;
+ }
if (viewp->getVisible() && viewp->getRect().isValid())
{
@@ -1099,7 +1107,10 @@ void LLView::drawChildren()
LLUI::pushMatrix();
{
LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom, 0.f);
+ // flag the fact we are in draw here, in case overridden draw() method attempts to remove this widget
+ viewp->mInDraw = true;
viewp->draw();
+ viewp->mInDraw = false;
if (sDebugRects)
{