diff options
| author | dolphin <dolphin@lindenlab.com> | 2014-06-17 13:09:15 -0700 |
|---|---|---|
| committer | dolphin <dolphin@lindenlab.com> | 2014-06-17 13:09:15 -0700 |
| commit | 299921de323eb9b6844cd7b6f6b8da3490ee3747 (patch) | |
| tree | dcb4c5c257622c20014a0b986dc8e2d1c25a10c7 /indra/llui/lltabcontainer.cpp | |
| parent | 89ea1cbc7acee8878c36a5795dd3df12a913c513 (diff) | |
| parent | 977476171ddcc057d7c28b6c14ae988b8189ed75 (diff) | |
Merge with 3.7.9-release
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
| -rwxr-xr-x | indra/llui/lltabcontainer.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index e4f78821cb..4b08798892 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1140,6 +1140,17 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) addChild( btn, 0 ); } } + else + { + if (textbox) + { + LLUICtrl::addChild(textbox, 0); + } + if (btn) + { + LLUICtrl::addChild(btn, 0); + } + } if (child) { @@ -1636,16 +1647,26 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon) { LLTabTuple* tuple = getTabByPanel(child); LLCustomButtonIconCtrl* button; + bool hasButton = false; if(tuple) { button = dynamic_cast<LLCustomButtonIconCtrl*>(tuple->mButton); if(button) { + hasButton = true; button->setIcon(icon); reshapeTuple(tuple); } } + + if (!hasButton && (icon != NULL)) + { + // It was assumed that the tab's button would take ownership of the icon pointer. + // But since the tab did not have a button, kill the icon to prevent the memory + // leak. + icon->die(); + } } void LLTabContainer::reshapeTuple(LLTabTuple* tuple) |
