diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llview.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index d150e10..22d426a 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp | |||
@@ -194,8 +194,10 @@ LLView::~LLView() | |||
194 | for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) | 194 | for (itor = mDispatchList.begin(); itor != mDispatchList.end(); ++itor) |
195 | { | 195 | { |
196 | (*itor).second->clearDispatchers(); | 196 | (*itor).second->clearDispatchers(); |
197 | delete (*itor).second; | ||
198 | } | 197 | } |
198 | |||
199 | std::for_each(mFloaterControls.begin(), mFloaterControls.end(), | ||
200 | DeletePairedPointer()); | ||
199 | } | 201 | } |
200 | 202 | ||
201 | // virtual | 203 | // virtual |
@@ -367,22 +369,25 @@ void LLView::addChildAtEnd(LLView* child, S32 tab_group) | |||
367 | } | 369 | } |
368 | 370 | ||
369 | // remove the specified child from the view, and set it's parent to NULL. | 371 | // remove the specified child from the view, and set it's parent to NULL. |
370 | void LLView::removeChild( LLView* child ) | 372 | void LLView::removeChild(LLView* child, BOOL deleteIt) |
371 | { | 373 | { |
372 | if (child->mParentView == this) | 374 | if (child->mParentView == this) |
373 | { | 375 | { |
374 | mChildList.remove( child ); | 376 | mChildList.remove( child ); |
375 | child->mParentView = NULL; | 377 | child->mParentView = NULL; |
378 | if (child->isCtrl()) | ||
379 | { | ||
380 | removeCtrl((LLUICtrl*)child); | ||
381 | } | ||
382 | if (deleteIt) | ||
383 | { | ||
384 | delete child; | ||
385 | } | ||
376 | } | 386 | } |
377 | else | 387 | else |
378 | { | 388 | { |
379 | llerrs << "LLView::removeChild called with non-child" << llendl; | 389 | llerrs << "LLView::removeChild called with non-child" << llendl; |
380 | } | 390 | } |
381 | |||
382 | if (child->isCtrl()) | ||
383 | { | ||
384 | removeCtrl((LLUICtrl*)child); | ||
385 | } | ||
386 | } | 391 | } |
387 | 392 | ||
388 | void LLView::addCtrlAtEnd(LLUICtrl* ctrl, S32 tab_group) | 393 | void LLView::addCtrlAtEnd(LLUICtrl* ctrl, S32 tab_group) |
@@ -2507,7 +2512,6 @@ void LLView::deregisterEventListener(LLString name) | |||
2507 | dispatch_list_t::iterator itor = mDispatchList.find(name); | 2512 | dispatch_list_t::iterator itor = mDispatchList.find(name); |
2508 | if (itor != mDispatchList.end()) | 2513 | if (itor != mDispatchList.end()) |
2509 | { | 2514 | { |
2510 | delete itor->second; | ||
2511 | mDispatchList.erase(itor); | 2515 | mDispatchList.erase(itor); |
2512 | } | 2516 | } |
2513 | } | 2517 | } |