diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llfolderviewmodel.cpp | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index adadf979b7..eae0d2f3e4 100644 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -50,7 +50,14 @@ LLFolderViewModelItemCommon::LLFolderViewModelItemCommon(LLFolderViewModelInterf  LLFolderViewModelItemCommon::~LLFolderViewModelItemCommon()  { -    clearChildren(); +    // Children don't belong to model, but to LLFolderViewItem, just mark them as having no parent +    std::for_each(mChildren.begin(), mChildren.end(), [](LLFolderViewModelItem* c) {c->setParent(NULL); }); + +    // Don't leave dead pointer in parent +    if (mParent) +    { +        mParent->removeChild(this); +    }  }  void LLFolderViewModelItemCommon::dirtyFilter() | 
