From da23e0f925742045013fc09e75b962c65e1cda88 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 13 Sep 2016 20:32:34 +0300 Subject: MAINT-6726 Fixed LLLineEditor menus staying in memory forever --- indra/llui/lllineeditor.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/llui/lllineeditor.cpp') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 492c9315d1..c89e1dac1d 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2636,10 +2636,17 @@ void LLLineEditor::showContextMenu(S32 x, S32 y) void LLLineEditor::setContextMenu(LLContextMenu* new_context_menu) { - if (new_context_menu) - mContextMenuHandle = new_context_menu->getHandle(); - else - mContextMenuHandle.markDead(); + LLContextMenu* menu = static_cast(mContextMenuHandle.get()); + if (menu) + { + menu->die(); + mContextMenuHandle.markDead(); + } + + if (new_context_menu) + { + mContextMenuHandle = new_context_menu->getHandle(); + } } void LLLineEditor::setFont(const LLFontGL* font) -- cgit v1.2.3