diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-01-05 18:20:30 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-01-05 18:20:47 +0200 |
commit | db161b6f85a266ee9d883e3180874de898ccda0e (patch) | |
tree | 5c012e271be4652ab3e4300603679f387f58646d /indra/llui | |
parent | 5691d302ef876a7e6fb6861441f14e5e7f0c7735 (diff) |
SL-14074 Resolved potential cause of conversation crashes
Models (listeners) belong to folder-views, deleting all of them means that not only proper cleanup procedure won't be followed, and view might try clean dead pointer.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfolderviewmodel.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 84a1539094..4739d4e6fe 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -204,6 +204,7 @@ public: virtual bool hasChildren() const = 0; virtual void addChild(LLFolderViewModelItem* child) = 0; virtual void removeChild(LLFolderViewModelItem* child) = 0; + virtual void clearChildren() = 0; // This method will be called to determine if a drop can be // performed, and will set drop to TRUE if a drop is @@ -301,9 +302,8 @@ public: virtual void clearChildren() { - // As this is cleaning the whole list of children wholesale, we do need to delete the pointed objects - // This is different and not equivalent to calling removeChild() on each child - std::for_each(mChildren.begin(), mChildren.end(), DeletePointer()); + // We are working with models that belong to views as LLPointers, clean the list, let poiters handle the rest + std::for_each(mChildren.begin(), mChildren.end(), [](LLFolderViewModelItem* c) {c->setParent(NULL); }); mChildren.clear(); dirtyDescendantsFilter(); dirtyFilter(); |