summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index cb1be5fabc..97879046a0 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -468,16 +468,6 @@ void set_underclothes_menu_options()
void init_menus()
{
S32 top = gViewerWindow->getRootView()->getRect().getHeight();
- S32 width = gViewerWindow->getRootView()->getRect().getWidth();
-
- //
- // Main menu bar
- //
- gMenuHolder = new LLViewerMenuHolderGL();
- gMenuHolder->setRect(LLRect(0, top, width, 0));
- gMenuHolder->setFollowsAll();
-
- LLMenuGL::sMenuContainer = gMenuHolder;
// Initialize actions
initialize_menus();
@@ -7078,6 +7068,11 @@ void handle_test_load_url(void*)
//
// LLViewerMenuHolderGL
//
+static LLDefaultChildRegistry::Register<LLViewerMenuHolderGL> r("menu_holder");
+
+LLViewerMenuHolderGL::LLViewerMenuHolderGL(const LLViewerMenuHolderGL::Params& p)
+: LLMenuHolderGL(p)
+{}
BOOL LLViewerMenuHolderGL::hideMenus()
{
@@ -7087,8 +7082,11 @@ BOOL LLViewerMenuHolderGL::hideMenus()
mParcelSelection = NULL;
mObjectSelection = NULL;
- gMenuBarView->clearHoverItem();
- gMenuBarView->resetMenuTrigger();
+ if (gMenuBarView)
+ {
+ gMenuBarView->clearHoverItem();
+ gMenuBarView->resetMenuTrigger();
+ }
return handled;
}