diff options
Diffstat (limited to 'source/blender/editors/space_outliner/tree/tree_iterator.cc')
-rw-r--r-- | source/blender/editors/space_outliner/tree/tree_iterator.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/tree/tree_iterator.cc b/source/blender/editors/space_outliner/tree/tree_iterator.cc index 85ff9e6437e..8d2b0b21433 100644 --- a/source/blender/editors/space_outliner/tree/tree_iterator.cc +++ b/source/blender/editors/space_outliner/tree/tree_iterator.cc @@ -43,13 +43,14 @@ void all_open(const SpaceOutliner &space_outliner, { LISTBASE_FOREACH_MUTABLE (TreeElement *, element, &subtree) { /* Get needed data out in case element gets freed. */ - const bool is_open = TSELEM_OPEN(element->store_elem, &space_outliner); + const TreeStoreElem *tselem = TREESTORE(element); const ListBase subtree = element->subtree; visitor(element); - /* Don't access element from now on, it may be freed. */ + /* Don't access element from now on, it may be freed. Note that the open/collapsed state may + * also have been changed in the visitor callback. */ - if (is_open) { + if (TSELEM_OPEN(tselem, &space_outliner)) { all_open(space_outliner, subtree, visitor); } } |