Skip to content
Snippets Groups Projects
Commit efeaba0a authored by Mike Antipov's avatar Mike Antipov
Browse files

Fixed normal bug EXT-4762 ( Crash on exit from viewer in LLPanelPeopleMenus::ContextMenu)

- reason: attempt to delete instance of the LLContextMenu from the LLPanelPeopleMenus::ContextMenu after it was deleted by menu holder on viewer exit.
- fix: check if menu is not dead via stored LLHandle of the menu before deleting.

--HG--
branch : product-engine
parent 10cbb9ea
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,14 @@ ContextMenu::~ContextMenu() ...@@ -61,7 +61,14 @@ ContextMenu::~ContextMenu()
// It can have registered Enable callbacks which are called from the LLMenuHolderGL::draw() // It can have registered Enable callbacks which are called from the LLMenuHolderGL::draw()
// via selected item (menu_item_call) by calling LLMenuItemCallGL::buildDrawLabel. // via selected item (menu_item_call) by calling LLMenuItemCallGL::buildDrawLabel.
// we can have a crash via using callbacks of deleted instance of ContextMenu. EXT-4725 // we can have a crash via using callbacks of deleted instance of ContextMenu. EXT-4725
if (mMenu) mMenu->die();
// menu holder deletes its menus on viewer exit, so we have no way to determine if instance
// of mMenu has already been deleted except of using LLHandle. EXT-4762.
if (!mMenuHandle.isDead())
{
mMenu->die();
mMenu = NULL;
}
} }
void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, S32 x, S32 y) void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, S32 x, S32 y)
...@@ -86,6 +93,7 @@ void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, ...@@ -86,6 +93,7 @@ void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids,
std::copy(uuids.begin(), uuids.end(), mUUIDs.begin()); std::copy(uuids.begin(), uuids.end(), mUUIDs.begin());
mMenu = createMenu(); mMenu = createMenu();
mMenuHandle = mMenu->getHandle();
mMenu->show(x, y); mMenu->show(x, y);
LLMenuGL::showPopup(spawning_view, mMenu, x, y); LLMenuGL::showPopup(spawning_view, mMenu, x, y);
} }
......
...@@ -62,6 +62,7 @@ class ContextMenu : public LLAvatarListItem::ContextMenu ...@@ -62,6 +62,7 @@ class ContextMenu : public LLAvatarListItem::ContextMenu
std::vector<LLUUID> mUUIDs; std::vector<LLUUID> mUUIDs;
LLContextMenu* mMenu; LLContextMenu* mMenu;
LLHandle<LLView> mMenuHandle;
}; };
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment