diff options
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 05c2247a35..1fab00b524 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -174,7 +174,6 @@ LLView::~LLView() for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) { (*itor).second->clearDispatchers(); - delete (*itor).second; } std::for_each(mFloaterControls.begin(), mFloaterControls.end(), @@ -350,22 +349,25 @@ void LLView::addChildAtEnd(LLView* child, S32 tab_group) } // remove the specified child from the view, and set it's parent to NULL. -void LLView::removeChild( LLView* child ) +void LLView::removeChild(LLView* child, BOOL deleteIt) { if (child->mParentView == this) { mChildList.remove( child ); child->mParentView = NULL; + if (child->isCtrl()) + { + removeCtrl((LLUICtrl*)child); + } + if (deleteIt) + { + delete child; + } } else { llerrs << "LLView::removeChild called with non-child" << llendl; } - - if (child->isCtrl()) - { - removeCtrl((LLUICtrl*)child); - } } void LLView::addCtrlAtEnd(LLUICtrl* ctrl, S32 tab_group) @@ -2490,7 +2492,6 @@ void LLView::deregisterEventListener(LLString name) dispatch_list_t::iterator itor = mDispatchList.find(name); if (itor != mDispatchList.end()) { - delete itor->second; mDispatchList.erase(itor); } } |