summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-09-13 20:32:34 +0300
committerandreykproductengine <akleshchev@productengine.com>2016-09-13 20:32:34 +0300
commitda23e0f925742045013fc09e75b962c65e1cda88 (patch)
tree39631ebc4f046f3b4416cfd4b91ba56ddabd57de /indra/llui/lllineeditor.cpp
parentff118b7d21633cc020b2fb4c833684b4f98b4e5e (diff)
MAINT-6726 Fixed LLLineEditor menus staying in memory forever
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp15
1 files changed, 11 insertions, 4 deletions
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<LLContextMenu*>(mContextMenuHandle.get());
+ if (menu)
+ {
+ menu->die();
+ mContextMenuHandle.markDead();
+ }
+
+ if (new_context_menu)
+ {
+ mContextMenuHandle = new_context_menu->getHandle();
+ }
}
void LLLineEditor::setFont(const LLFontGL* font)