diff options
author | Stinson Linden <stinson@lindenlab.com> | 2014-05-09 23:06:53 +0100 |
---|---|---|
committer | Stinson Linden <stinson@lindenlab.com> | 2014-05-09 23:06:53 +0100 |
commit | 8e7912f3821b3e20b528239b7ebfe0c6a9bffc71 (patch) | |
tree | 06432a7108761244371fc99846887f4b8caf48f9 /indra/newview | |
parent | c307bda68a3e473a45491ca3ecfeb63e4e3f72bc (diff) |
MAINT-4009: Improved patching of a memory leak for when menu items are created before the viewer window initialization has created the menu holder. See also changeset bc0743639926a84b38b4907d252eff1cc0498c7d.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llmediactrl.cpp | 8 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 90d4dd093b..c4b68bb7e1 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -390,10 +390,12 @@ BOOL LLMediaCtrl::postBuild () LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this)); - // stinson 05/05/2014 : cannot assert on the menu container being NULL because it will be during the processing of main_view.xml - // llassert(LLMenuGL::sMenuContainer != NULL); + // stinson 05/05/2014 : use this as the parent of the context menu if the static menu + // container has yet to be created + LLPanel* menuParent = (LLMenuGL::sMenuContainer != NULL) ? dynamic_cast<LLPanel*>(LLMenuGL::sMenuContainer) : dynamic_cast<LLPanel*>(this); + llassert(menuParent != NULL); mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( - "menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); + "menu_media_ctrl.xml", menuParent, LLViewerMenuHolderGL::child_registry_t::instance()); setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChanged, this, _2)); return TRUE; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 621baee0e6..2cb8e6a3ab 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1911,12 +1911,6 @@ void LLViewerWindow::initBase() gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder"); LLMenuGL::sMenuContainer = gMenuHolder; - - // stinson 05/05/2014 : the panel_progress.xml references a LLMediaCtrl(<web_browser></web_browser>) class - // which creates some menu items. However, because the Menu Holder is not initialized then, we need to - // update the parent for the menu items so they will be properly cleaned up. - LLMediaCtrl* mediaCtrl = getRootView()->findChild<LLMediaCtrl>("login_media_panel"); - mediaCtrl->updateContextMenuParent(LLMenuGL::sMenuContainer); } void LLViewerWindow::initWorldUI() |