diff options
author | Bastien Montagne <bastien@blender.org> | 2021-04-23 13:28:54 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-04-23 15:34:47 +0300 |
commit | 9afa738542881cf69aa89fd893351200324c107f (patch) | |
tree | 6bf979900fd5a7712e261c2a52da6ea70df116b3 /source/blender/blenkernel/BKE_outliner_treehash.h | |
parent | 5441f5fc90c600aa5bbd08c8cd212fb0734f86cc (diff) |
Fix bug/crash in ID bulk deletion code.
This is complex situation. Tagged ID deletion (used to delete several
data-blocks at once) removes IDs to be deleted from Main.
But when we remove deleted IDs' usages of other IDs (using
`BKE_libblock_relink_ex`), some specific post-process is required on
some types, like Collections. Those post-processes would in some cases
rely on data actually being in Main.
That failing condition would lead in existing code on missing processing
the very ID (collection) we were working on, leading to missing removing
some child collection pointers, leading to the crash (later on in
LayerCollection resync process).
For now we go with an optimization & fix that avoids processing all
collections in Main when we actually know which one we are working one
(case of `BKE_libblock_relink_ex`, but not of
`BKE_libblock_remap_locked`).
This is however yet another demonstration of the need to rework that
whole collection/layer resync process, since it is not only extremely
inneficient currently, but it also requires valid Main/ID state way too
deep into the remapping code.
NOTE: This fix may very well not catch/address all possible fail cases
here, dealing with the double parent/child relationships of collections
is challenging...
Issue reported by @eyecandy from the studio, thanks.
Diffstat (limited to 'source/blender/blenkernel/BKE_outliner_treehash.h')
0 files changed, 0 insertions, 0 deletions