diff options
author | Merov Linden <merov@lindenlab.com> | 2013-11-11 18:39:02 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-11-11 18:39:02 -0800 |
commit | e6b4b89bf12ae410fa87baf01117daa2a47754c0 (patch) | |
tree | 297264fd49797d75882b91bb80d68c1d196cacd5 /indra/llui | |
parent | 3111cf4ccf34f4bfe5aa0c1935f0a13c870a76ea (diff) |
MAINT-3320 : WIP : Use handle for elements that'll get deleted under us, quite a bit of debug spam to clean later
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llfolderview.cpp | 11 | ||||
-rwxr-xr-x | indra/llui/llfolderviewmodel.cpp | 8 |
2 files changed, 19 insertions, 0 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index cf449217f5..4d1c2a38d0 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -176,6 +176,7 @@ LLFolderView::LLFolderView(const Params& p) { mViewModel->setFolderView(this); mRoot = this; + llinfos << "Merov : create folder view, this = " << this << ", name = " << (std::string(p.name)) << ", model = " << getFolderViewModel() << llendl; LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); @@ -243,6 +244,7 @@ LLFolderView::LLFolderView(const Params& p) // Destroys the object LLFolderView::~LLFolderView( void ) { + llinfos << "Merov : delete folder view (start), this = " << this << ", model = " << getFolderViewModel() << llendl; closeRenamer(); // The release focus call can potentially call the @@ -264,7 +266,9 @@ LLFolderView::~LLFolderView( void ) mItems.clear(); mFolders.clear(); + mViewModel->setFolderView(NULL); mViewModel = NULL; + llinfos << "Merov : delete folder view (end), this = " << this << ", model = " << getFolderViewModel() << llendl; } BOOL LLFolderView::canFocusChildren() const @@ -1598,6 +1602,13 @@ void LLFolderView::update() // If this is associated with the user's inventory, don't do anything // until that inventory is loaded up. LLFastTimer t2(FTM_INVENTORY); + + // If there's no model, the view is in suspended state (being deleted) and shouldn't be updated + if (getFolderViewModel() == NULL) + { + return; + } + //llinfos << "Merov : update, this = " << this << ", model = " << getFolderViewModel() << llendl; if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault()) { diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 3363dc5316..48ca8156f2 100755 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -36,6 +36,10 @@ bool LLFolderViewModelCommon::needsSort(LLFolderViewModelItem* item) std::string LLFolderViewModelCommon::getStatusText() { + if (!mFolderView) + { + llinfos << "Merov : Trying LLFolderViewModelCommon::getStatusText() on a NULL mFolderView!!!" << llendl; + } if (!contentsReady() || mFolderView->getViewModelItem()->getLastFilterGeneration() < getFilter().getCurrentGeneration()) { return LLTrans::getString("Searching"); @@ -48,6 +52,10 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { + if (!mFolderView) + { + llinfos << "Merov : Trying LLFolderViewModelCommon::filter() on a NULL mFolderView!!!" << llendl; + } getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); mFolderView->getViewModelItem()->filter(getFilter()); } |