diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-10-19 23:53:53 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-10-19 23:53:53 +0300 |
| commit | f0cd5407c429f1033ede01e96a107daef70814fd (patch) | |
| tree | 3d10de84512f0e6a4ad663c7fbee5dc23317130c /indra/llui/lllineeditor.cpp | |
| parent | 46427eefd4d27704397f4fe3cf3bc9d29946c1b2 (diff) | |
| parent | 5456af4c8ce8c2bef7d544cd8a928ea399832756 (diff) | |
SL-18412 Merge remote-tracking branch 'RyeMutt/viewer/menu-leaks' into DRTVWR-570-maint-Q
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
| -rw-r--r-- | indra/llui/lllineeditor.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 33037b5001..f16f8c3e8d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -209,13 +209,6 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) setPrevalidateInput(p.prevalidate_input_callback()); setPrevalidate(p.prevalidate_callback()); - - llassert(LLMenuGL::sMenuContainer != NULL); - LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu> - ("menu_text_editor.xml", - LLMenuGL::sMenuContainer, - LLMenuHolderGL::child_registry_t::instance()); - setContextMenu(menu); } LLLineEditor::~LLLineEditor() @@ -2637,6 +2630,15 @@ LLWString LLLineEditor::getConvertedText() const void LLLineEditor::showContextMenu(S32 x, S32 y) { LLContextMenu* menu = static_cast<LLContextMenu*>(mContextMenuHandle.get()); + if (!menu) + { + llassert(LLMenuGL::sMenuContainer != NULL); + menu = LLUICtrlFactory::createFromFile<LLContextMenu> + ("menu_text_editor.xml", + LLMenuGL::sMenuContainer, + LLMenuHolderGL::child_registry_t::instance()); + setContextMenu(menu); + } if (menu) { |
