From d5482e6c74cabb2b9e79c76d259ed13acc3873aa Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 6 Feb 2013 03:09:17 +0100 Subject: [PATCH] Do not pre- increment the loop iterator in LLView::drawChildren This is in fact much safer, because the only way to invalidate an interator in the first place (in this code) is by calling removeChild, which *already* has an assert never to remove a child that is being iterated over (by means of the mInDraw flag). --- indra/llui/llview.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 40ee816a7..6c1bce689 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1170,16 +1170,13 @@ void LLView::drawChildren() LLView* rootp = getRootView(); ++sDepth; - for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();) // ++child_iter) + for (child_list_const_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend(); ++child_iter) { - child_list_reverse_iter_t child = child_iter++; - LLView *viewp = *child; - - if (viewp == NULL) - { - continue; - } - + LLView *viewp = *child_iter; + if (viewp == NULL) + { + continue; + } if (viewp->getVisible() && /*viewp != focus_view && */viewp->getRect().isValid()) {