[Bf-blender-cvs] [4efe8fc8064] blender2.8: Fix crash when making static override of an object from a collection.

Bastien Montagne noreply at git.blender.org
Mon Jun 18 18:43:27 CEST 2018


Commit: 4efe8fc806422c9e181cc7d6664a23745e3344b8
Author: Bastien Montagne
Date:   Mon Jun 18 18:40:54 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4efe8fc806422c9e181cc7d6664a23745e3344b8

Fix crash when making static override of an object from a collection.

Since we free collection caches when we remap one of their objects, we
also need to tell depsgraph to flush this into the COWs of that
collection, otherwise things like draw code can access freed memory...

===================================================================

M	source/blender/blenkernel/intern/layer.c

===================================================================

diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 2b44a36a0d8..3ed16b57dcc 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -759,6 +759,7 @@ void BKE_main_collection_sync_remap(const Main *bmain)
 
 	for (Collection *collection = bmain->collection.first; collection; collection = collection->id.next) {
 		BKE_collection_object_cache_free(collection);
+		DEG_id_tag_update_ex((Main *)bmain, &collection->id, DEG_TAG_COPY_ON_WRITE);
 	}
 
 	BKE_main_collection_sync(bmain);



More information about the Bf-blender-cvs mailing list