Skip to content
Snippets Groups Projects
Commit 620ee989 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-17772 Crash and a memory leak in LLPanelInventoryListItemBase

1. text_params, not text_aprams, due to this viewer was reusing same params and failing to create mTitleCtrl
2. All ctrls should be owned.
parent dc5a293e
No related branches found
No related tags found
No related merge requests found
......@@ -298,31 +298,41 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem
applyXUILayout(icon_params, this);
mIconCtrl = LLUICtrlFactory::create<LLIconCtrl>(icon_params);
if (mIconCtrl)
{
addChild(mIconCtrl);
}
else
if (!mIconCtrl)
{
LLIconCtrl::Params icon_params;
icon_params.name = "item_icon";
mIconCtrl = LLUICtrlFactory::create<LLIconCtrl>(icon_params);
}
if (mIconCtrl)
{
addChild(mIconCtrl);
}
else
{
LL_ERRS() << "Failed to create mIconCtrl" << LL_ENDL;
}
LLTextBox::Params text_params(params.item_name);
applyXUILayout(text_params, this);
mTitleCtrl = LLUICtrlFactory::create<LLTextBox>(text_params);
if (mTitleCtrl)
if (!mTitleCtrl)
{
addChild(mTitleCtrl);
}
else
{
LLTextBox::Params text_aprams;
LLTextBox::Params text_params;
text_params.name = "item_title";
mTitleCtrl = LLUICtrlFactory::create<LLTextBox>(text_params);
}
if (mTitleCtrl)
{
addChild(mTitleCtrl);
}
else
{
LL_ERRS() << "Failed to create mTitleCtrl" << LL_ENDL;
}
}
class WidgetVisibilityChanger
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment