diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-11-06 23:17:30 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-11-06 23:17:30 +0200 |
commit | 561da5bd7f32e5d09849ac97c69b1acf07cd9a0f (patch) | |
tree | 65947a54cdcddc6e1756576d813ee6994f7709c7 /indra/llui | |
parent | dc136e8dc886cf4798804757d3002f5711995b97 (diff) |
SL-14270 Crash fix
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() |