diff options
author | Richard Linden <none@none> | 2010-09-29 16:24:31 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2010-09-29 16:24:31 -0700 |
commit | af4b2247005268dbf92f8bc6994c7048b1035454 (patch) | |
tree | 723b29533cf17c659c2379e239fd8d25041130e7 /indra/newview | |
parent | 68b4d9164ccf2b3bb643f153be4d3b2821c4d9d9 (diff) |
final fix for llcontextmenugl crash on exit
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lllistcontextmenu.cpp | 28 | ||||
-rw-r--r-- | indra/newview/lllistcontextmenu.h | 3 |
2 files changed, 14 insertions, 17 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(); } } diff --git a/indra/newview/lllistcontextmenu.h b/indra/newview/lllistcontextmenu.h index 5dedc30b0c..fabd68ee20 100644 --- a/indra/newview/lllistcontextmenu.h +++ b/indra/newview/lllistcontextmenu.h @@ -71,8 +71,7 @@ protected: static void handleMultiple(functor_t functor, const uuid_vec_t& ids); uuid_vec_t mUUIDs; - LLContextMenu* mMenu; - LLHandle<LLView> mMenuHandle; + LLHandle<LLContextMenu> mMenuHandle; }; #endif // LL_LLLISTCONTEXTMENU_H |