Commit: fcf6f78d194289c3cc7a5a7a18efcbd24571c822
Author: Bastien Montagne
Date:   Sat Nov 10 16:22:41 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBfcf6f78d194289c3cc7a5a7a18efcbd24571c822

Fix (unreported) crash when deleting collection in freshly duplicated scene.

>From startup .blend, add a 'full copy' new scene, and delete its
Collection 1.001 collection. That would make blender crash, once again
due to NULL collection pointer in some ChildrenCollection struct...

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

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

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

diff --git a/source/blender/blenkernel/intern/library_remap.c 
b/source/blender/blenkernel/intern/library_remap.c
index 8a011b55cf3..404028f336e 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -323,10 +323,14 @@ static void 
libblock_remap_data_postprocess_object_update(Main *bmain, Object *o
 /* Can be called with both old_collection and new_collection being NULL,
  * this means we have to check whole Main database then. */
 static void libblock_remap_data_postprocess_collection_update(
-        Main *bmain, Collection *old_collection, Collection *new_collection)
+        Main *bmain, Collection *UNUSED(old_collection), Collection 
*new_collection)
 {
        if (new_collection == NULL) {
-               BKE_collections_child_remove_nulls(bmain, old_collection);
+               /* XXX Complex cases can lead to NULL pointers in other 
collections than old_collection,
+                * and BKE_main_collection_sync_remap() does not tolerate any 
of those, so for now always check whole
+                * existing collections for NULL pointers.
+                * I'd consider optimizing that whole collection remapping 
process a TODO for later. */
+               BKE_collections_child_remove_nulls(bmain, NULL 
/*old_collection*/);
        }
 
        BKE_main_collection_sync_remap(bmain);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to