summaryrefslogtreecommitdiff
path: root/indra/llui/lluictrlfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lluictrlfactory.cpp')
-rw-r--r--indra/llui/lluictrlfactory.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index c75c6714f8..c2dc9a1e90 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -104,10 +104,17 @@ static LLRegisterWidget<LLUICtrlLocate> r2("pad");
// LLUICtrlFactory()
//-----------------------------------------------------------------------------
LLUICtrlFactory::LLUICtrlFactory()
+ : mDummyPanel(NULL)
{
setupPaths();
}
+LLUICtrlFactory::~LLUICtrlFactory()
+{
+ delete mDummyPanel;
+ mDummyPanel = NULL;
+}
+
void LLUICtrlFactory::setupPaths()
{
LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml");
@@ -428,10 +435,6 @@ void LLUICtrlFactory::rebuild()
LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node)
{
- // panel for holding dummy widgets, so they have a parent for layout purposes, etc.
- // does not manage lifetime of child widgets
- static LLPanel dummy_panel;
-
LLString ctrl_type = node->getName()->mString;
LLString::toLower(ctrl_type);
@@ -445,7 +448,11 @@ LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node)
if (parent == NULL)
{
- parent = &dummy_panel;
+ if (mDummyPanel == NULL)
+ {
+ mDummyPanel = new LLPanel;
+ }
+ parent = mDummyPanel;
}
LLView *ctrl = func(node, parent, this);