Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-07-21 19:11:13 +0300
committerBastien Montagne <bastien@blender.org>2022-07-21 19:11:13 +0300
commita36f029459f34acb457c566d0d95e058122623f1 (patch)
treef5be89eecba7eb737f54b36a2b47122e6cc5a932 /source/blender/blenkernel/intern/layer.c
parentef5b435e8fa3e244a5f68bdde999dea8e6b8bc92 (diff)
Fix crash in some very rare case in remapping code.
Actualy 'safe' building of the base has in view layers (as part of `BKE_main_collection_sync_remap`) would only happen when there was already an existing one, otherwise it was skipped, and rebuilt later (without the support for doublons) in collection sync code. Very odd that that error was never spotted before, issue in code has been there for a long time already. Probably only happens in rare cases (specific conjuction of factors during remapping of old ID into itelf new id)? Reported by @hjalti from Blender studio. Reproducing case: `heist/pro/shots/050_alarm/050_0160/050_0160.anim.blend`, r1407
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r--source/blender/blenkernel/intern/layer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 534ff7f1fbc..ac582ff69ca 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -1377,12 +1377,12 @@ void BKE_main_collection_sync_remap(const Main *bmain)
if (view_layer->object_bases_hash) {
BLI_ghash_free(view_layer->object_bases_hash, NULL, NULL);
view_layer->object_bases_hash = NULL;
-
- /* Directly re-create the mapping here, so that we can also deal with duplicates in
- * `view_layer->object_bases` list of bases properly. This is the only place where such
- * duplicates should be fixed, and not considered as a critical error. */
- view_layer_bases_hash_create(view_layer, true);
}
+
+ /* Directly re-create the mapping here, so that we can also deal with duplicates in
+ * `view_layer->object_bases` list of bases properly. This is the only place where such
+ * duplicates should be fixed, and not considered as a critical error. */
+ view_layer_bases_hash_create(view_layer, true);
}
BKE_collection_object_cache_free(scene->master_collection);