From 41495707d207db94db238e0bce5bd2dd90cbdbef Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 14 Jan 2022 19:08:02 +0100 Subject: Fix incorrect destruction of Outliner tree-elements `TreeElement` isn't a trivial type anymore, so `MEM_delete()` should be called, which calls the destructor. AFAICS this would cause a memory leak, since the contained `unique_ptr` is allocated but not destructed correctly - but it's not using the guarded allocator so woudn't be reported. --- source/blender/editors/space_outliner/outliner_tree.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc index 5f378a02052..92e12756b16 100644 --- a/source/blender/editors/space_outliner/outliner_tree.cc +++ b/source/blender/editors/space_outliner/outliner_tree.cc @@ -218,7 +218,7 @@ void outliner_free_tree_element(TreeElement *element, ListBase *parent_subtree) MEM_freeN((void *)element->name); } element->type = nullptr; - MEM_freeN(element); + MEM_delete(element); } /* ********************************************************* */ -- cgit v1.2.3