MAINT-6726 Fixed LLLineEditor menus staying in memory forever
parent
ff118b7d21
commit
da23e0f925
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ public:
|
|||
|
||||
void setReplaceNewlinesWithSpaces(BOOL replace);
|
||||
|
||||
void setContextMenu(LLContextMenu* new_context_menu);
|
||||
void resetContextMenu() { setContextMenu(NULL); };
|
||||
|
||||
private:
|
||||
// private helper methods
|
||||
|
|
@ -308,6 +308,8 @@ private:
|
|||
virtual S32 getPreeditFontSize() const;
|
||||
virtual LLWString getPreeditString() const { return getWText(); }
|
||||
|
||||
void setContextMenu(LLContextMenu* new_context_menu);
|
||||
|
||||
protected:
|
||||
LLUIString mText; // The string being edited.
|
||||
std::string mPrevText; // Saved string for 'ESC' revert
|
||||
|
|
|
|||
|
|
@ -1961,7 +1961,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
|
|||
LLContextMenu* menu = static_cast<LLContextMenu*>(mPopupMenuHandle.get());
|
||||
if (menu)
|
||||
{
|
||||
menu->updateParent(NULL);
|
||||
menu->die();
|
||||
mPopupMenuHandle.markDead();
|
||||
}
|
||||
llassert(LLMenuGL::sMenuContainer != NULL);
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
|
|||
params.commit_on_focus_lost(false);
|
||||
params.follows.flags(FOLLOWS_ALL);
|
||||
mTextEntry = LLUICtrlFactory::create<LLURLLineEditor>(params);
|
||||
mTextEntry->setContextMenu(NULL);
|
||||
mTextEntry->resetContextMenu();
|
||||
addChild(mTextEntry);
|
||||
// LLLineEditor is replaced with LLLocationLineEditor
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue