summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-07-24 14:42:28 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-07-24 14:42:28 -0700
commitdecd8a435d8fb15bab52eec9e447b176e33eb5cf (patch)
treeb9c345d5965f978a500e5712b20d0ca1e7e5a54f
parentf303eeccf705f677e48c5738e5119352fd86b31d (diff)
CHUI-211: Problem was due to a non-heap variable being deleted and then referenced later (which was found by ProductEngine). Also the crash occurred at a specifc location llpangelobjectinventory::reset() during a static_cast, so now using a dynamic_cast as a safeguard.
-rw-r--r--indra/llui/llfolderview.cpp3
-rw-r--r--indra/newview/llpanelobjectinventory.cpp7
2 files changed, 8 insertions, 2 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 8ade17b763..10729a3eae 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -266,7 +266,8 @@ LLFolderView::~LLFolderView( void )
mItems.clear();
mFolders.clear();
- delete mViewModel;
+ //product engine bugfix, prevent deletion of non-heap data
+ //delete mViewModel;
mViewModel = NULL;
}
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index ca20051a51..937d3bb8c5 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1565,7 +1565,12 @@ void LLPanelObjectInventory::reset()
mFolders = LLUICtrlFactory::create<LLFolderView>(p);
// this ensures that we never say "searching..." or "no items found"
//TODO RN: make this happen by manipulating filter object directly
- static_cast<LLInventoryFilter*>(mFolders->getFolderViewModel()->getFilter())->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS);
+ LLInventoryFilter* inventoryFilter = dynamic_cast<LLInventoryFilter*>(mFolders->getFolderViewModel()->getFilter());
+ if(inventoryFilter)
+ {
+ inventoryFilter->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS);
+ }
+
mFolders->setCallbackRegistrar(&mCommitCallbackRegistrar);
if (hasFocus())