From e5375795e1ac519eb62b79807d5f5d4c5841990d Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Wed, 30 Apr 2014 23:10:35 +0100 Subject: MAINT-4009: Patching the LLTabContainer that was leaking some child views and their associated llimage allocations. --- indra/llui/lltabcontainer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llui/lltabcontainer.cpp') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index ebc6183b8b..273e9c1ef6 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) { -- cgit v1.2.3 From 8247f51684ecc73cc60fa64b2fb0de3dce2a0c26 Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Fri, 2 May 2014 00:32:31 +0100 Subject: MAINT-4009: Patching the memory leak occurring in the scenario where avatar icon was being created, but the tab container did not have a button to accept the gieven icon. --- indra/llui/lltabcontainer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/llui/lltabcontainer.cpp') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 273e9c1ef6..6f858cdeb3 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1647,16 +1647,26 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon) { LLTabTuple* tuple = getTabByPanel(child); LLCustomButtonIconCtrl* button; + bool hasButton = false; if(tuple) { button = dynamic_cast(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) -- cgit v1.2.3