diff options
author | Oz Linden <oz@lindenlab.com> | 2011-01-07 10:39:05 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-01-07 10:39:05 -0500 |
commit | e1e38c4cee980f815091cd94c8a529ffe3e24918 (patch) | |
tree | 35b16f61bd120f83bb74a77d4417dce1108e0542 /indra/newview/lllistcontextmenu.cpp | |
parent | c02d6a319f378d5dcc34c51b20f556f175d2a40a (diff) | |
parent | 09c01c4e925833873a83665fe0642637b65e547e (diff) |
merge changes for storm-34
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(); } } |