summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llmenugl.cpp7
-rw-r--r--indra/llui/llview.cpp6
-rw-r--r--indra/newview/llfavoritesbar.cpp4
-rw-r--r--indra/newview/llfloatercolorpicker.cpp2
-rw-r--r--indra/newview/llfloatersnapshot.cpp2
-rw-r--r--indra/newview/llfolderview.cpp4
-rw-r--r--indra/newview/llgrouplist.cpp2
-rw-r--r--indra/newview/llpanelpeople.cpp10
-rwxr-xr-xindra/newview/llpanelprofile.cpp2
-rw-r--r--indra/newview/llpanelteleporthistory.cpp2
10 files changed, 26 insertions, 15 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index cb237fca7c..95ecbb1c94 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -947,9 +947,14 @@ LLMenuItemBranchGL::LLMenuItemBranchGL(const LLMenuItemBranchGL::Params& p)
LLMenuItemBranchGL::~LLMenuItemBranchGL()
{
- delete mBranchHandle.get();
+ if (mBranchHandle.get())
+ {
+ mBranchHandle.get()->die();
+ }
}
+
+
// virtual
LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse) const
{
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 486babb0ab..1529381773 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),
@@ -281,6 +282,8 @@ void LLView::moveChildToBackOfTabGroup(LLUICtrl* child)
// virtual
bool LLView::addChild(LLView* child, S32 tab_group)
{
+ llassert_always(mInDraw == false);
+
if (!child)
{
return false;
@@ -330,6 +333,7 @@ bool LLView::addChildInBack(LLView* child, S32 tab_group)
// remove the specified child from the view, and set it's parent to NULL.
void LLView::removeChild(LLView* child)
{
+ llassert_always(mInDraw == false);
//llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs
if (child->mParentView == this)
{
@@ -1081,6 +1085,7 @@ void LLView::draw()
void LLView::drawChildren()
{
+ mInDraw = true;
if (!mChildList.empty())
{
LLView* rootp = LLUI::getRootView();
@@ -1119,6 +1124,7 @@ void LLView::drawChildren()
}
--sDepth;
}
+ mInDraw = false;
}
void LLView::dirtyRect()
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 4f2fd47488..f4b6dc2c81 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -405,8 +405,8 @@ LLFavoritesBarCtrl::~LLFavoritesBarCtrl()
{
gInventory.removeObserver(this);
- delete mOverflowMenuHandle.get();
- delete mContextMenuHandle.get();
+ if (mOverflowMenuHandle.get()) mOverflowMenuHandle.get()->die();
+ if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
}
BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 659e52271a..05d73c2416 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -271,7 +271,7 @@ void LLFloaterColorPicker::destroyUI ()
if ( mSwatchView )
{
this->removeChild ( mSwatchView );
- delete mSwatchView;
+ mSwatchView->die();;
mSwatchView = NULL;
}
}
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 1b3290d5a8..2dd031b5d3 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1977,7 +1977,7 @@ LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key)
// Destroys the object
LLFloaterSnapshot::~LLFloaterSnapshot()
{
- delete impl.mPreviewHandle.get();
+ if (impl.mPreviewHandle.get()) impl.mPreviewHandle.get()->die();
//unfreeze everything else
gSavedSettings.setBOOL("FreezeTime", FALSE);
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 6ec2598e44..20fe85472f 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -299,7 +299,7 @@ LLFolderView::~LLFolderView( void )
mAutoOpenItems.removeAllNodes();
gIdleCallbacks.deleteFunction(idle, this);
- delete mPopupMenuHandle.get();
+ if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
mAutoOpenItems.removeAllNodes();
clearSelection();
@@ -1969,7 +1969,7 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
void LLFolderView::deleteAllChildren()
{
closeRenamer();
- delete mPopupMenuHandle.get();
+ if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
mPopupMenuHandle = LLHandle<LLView>();
mScrollContainer = NULL;
mRenameItem = NULL;
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index f7ed1116cb..bbf66ca750 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -95,7 +95,7 @@ LLGroupList::LLGroupList(const Params& p)
LLGroupList::~LLGroupList()
{
gAgent.removeListener(this);
- delete mContextMenuHandle.get();
+ if (mContextMenuHandle.get()) mContextMenuHandle.get()->die();
}
// virtual
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index d5e289e6e6..9c46f04abf 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -526,11 +526,11 @@ LLPanelPeople::~LLPanelPeople()
LLVoiceClient::getInstance()->removeObserver(this);
}
- delete mGroupPlusMenuHandle.get();
- delete mNearbyViewSortMenuHandle.get();
- delete mFriendsViewSortMenuHandle.get();
- delete mGroupsViewSortMenuHandle.get();
- delete mRecentViewSortMenuHandle.get();
+ if (mGroupPlusMenuHandle.get()) mGroupPlusMenuHandle.get()->die();
+ if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
+ if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
+ if (mGroupsViewSortMenuHandle.get()) mGroupsViewSortMenuHandle.get()->die();
+ if (mRecentViewSortMenuHandle.get()) mRecentViewSortMenuHandle.get()->die();
}
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index b1eeabb028..e2e7006773 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -177,7 +177,7 @@ LLPanelProfile::ChildStack::~ChildStack()
LLView* viewp = *it;
if (viewp)
{
- delete viewp;
+ viewp->die();
}
}
mStack.pop_back();
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index d3543daff0..1f1cccad85 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -388,7 +388,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
{
LLTeleportHistoryFlatItemStorage::instance().purge();
- delete mGearMenuHandle.get();
+ if (mGearMenuHandle.get()) mGearMenuHandle.get()->die();
mTeleportHistoryChangedConnection.disconnect();
}