diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-31 17:14:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-03 17:29:59 +0300 |
commit | b812dfd1611e045a1446c70b81f830ae67fa3eab (patch) | |
tree | 3e092c70be295acfadc1516484a3725d54c98481 /source/blender/blenkernel/intern/layer.c | |
parent | 27c954386b279c480410b12e30ca5bd8e57629e7 (diff) |
Fix T56622: crash and other bugs deleting scenes.
Simplify library remapping code to handle special collection/object links
in postprocess. Previously base contained the actual object link which
needed special handling in preprocess, now objects are linked through
collection and the base cache can be updated in postprocess.
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 4df1b72d02a..707e1738af9 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -80,7 +80,7 @@ static LayerCollection *layer_collection_add(ListBase *lb_parent, Collection *co static void layer_collection_free(ViewLayer *view_layer, LayerCollection *lc) { if (lc == view_layer->active_collection) { - view_layer->active_collection = view_layer->layer_collections.first; + view_layer->active_collection = NULL; } for (LayerCollection *nlc = lc->layer_collections.first; nlc; nlc = nlc->next) { @@ -311,7 +311,9 @@ static void view_layer_bases_hash_create(ViewLayer *view_layer) view_layer->object_bases_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); for (Base *base = view_layer->object_bases.first; base; base = base->next) { - BLI_ghash_insert(view_layer->object_bases_hash, base->object, base); + if (base->object) { + BLI_ghash_insert(view_layer->object_bases_hash, base->object, base); + } } BLI_mutex_unlock(&hash_lock); @@ -786,7 +788,9 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) view_layer->basact = NULL; } - BLI_ghash_remove(view_layer->object_bases_hash, base->object, NULL, NULL); + if (base->object) { + BLI_ghash_remove(view_layer->object_bases_hash, base->object, NULL, NULL); + } } BLI_freelistN(&view_layer->object_bases); |