diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-12-09 16:48:07 -0800 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-12-09 16:48:07 -0800 |
commit | 95445fb1b56a60145933db0891133230c87274b8 (patch) | |
tree | f9b03971e89800c68b4c4430b13c90af6cba51e7 /indra/newview/lllistcontextmenu.cpp | |
parent | 089665ce4eab97d0ab58e08914f852219ed3fae7 (diff) | |
parent | cf6147f7c092e6ca10697dea341099c5e281df00 (diff) |
Merge with viewer-development.
Diffstat (limited to 'indra/newview/lllistcontextmenu.cpp')
-rw-r--r-- | indra/newview/lllistcontextmenu.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/indra/newview/lllistcontextmenu.cpp b/indra/newview/lllistcontextmenu.cpp index ea744072d2..6421ab42bf 100644 --- a/indra/newview/lllistcontextmenu.cpp +++ b/indra/newview/lllistcontextmenu.cpp @@ -36,7 +36,6 @@ #include "llviewermenu.h" // for LLViewerMenuHolderGL LLListContextMenu::LLListContextMenu() -: mMenu(NULL) { } @@ -51,23 +50,22 @@ LLListContextMenu::~LLListContextMenu() // of mMenu has already been deleted except of using LLHandle. EXT-4762. if (!mMenuHandle.isDead()) { - mMenu->die(); - mMenu = NULL; + mMenuHandle.get()->die(); } } void LLListContextMenu::show(LLView* spawning_view, const uuid_vec_t& uuids, S32 x, S32 y) { - if (mMenu) + LLContextMenu* menup = mMenuHandle.get(); + if (menup) { //preventing parent (menu holder) from deleting already "dead" context menus on exit - LLView* parent = mMenu->getParent(); + LLView* parent = menup->getParent(); if (parent) { - parent->removeChild(mMenu); + parent->removeChild(menup); } - delete mMenu; - mMenu = NULL; + delete menup; mUUIDs.clear(); } @@ -79,23 +77,23 @@ void LLListContextMenu::show(LLView* spawning_view, const uuid_vec_t& uuids, S32 mUUIDs.resize(uuids.size()); std::copy(uuids.begin(), uuids.end(), mUUIDs.begin()); - mMenu = createMenu(); - if (!mMenu) + menup = createMenu(); + if (!menup) { llwarns << "Context menu creation failed" << llendl; return; } - mMenuHandle = mMenu->getHandle(); - mMenu->show(x, y); - LLMenuGL::showPopup(spawning_view, mMenu, x, y); + mMenuHandle = menup->getHandle(); + menup->show(x, y); + LLMenuGL::showPopup(spawning_view, menup, x, y); } void LLListContextMenu::hide() { - if(mMenu) + if(mMenuHandle.get()) { - mMenu->hide(); + mMenuHandle.get()->hide(); } } |