Fix T57616: Deleting particle system instance object leads to crash
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 23 Nov 2018 11:00:34 +0000 (12:00 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 23 Nov 2018 11:03:26 +0000 (12:03 +0100)
Explicitly tag copy-on-write form library remap. Previously, this
tag was used implicitly via geometry/transform tagging, which worked
ok for objects. For non-objects we do need to ensure all copies has
correct pointer and the only way to do so is to pass tag explicitly.

There is probably more places in the library remap where this is
needed, but not being familiar with the code makes it difficult to
spot where possible tags are missing.

source/blender/blenkernel/intern/library_remap.c

index 404028f336e1e62ec2f11e3424f301adac2ae3b0..ba151ca692550cc17ae8ea393fdc6c2d5a854715 100644 (file)
@@ -241,7 +241,8 @@ static int foreach_libblock_remap_callback(void *user_data, ID *id_self, ID **id
                else {
                        if (!is_never_null) {
                                *id_p = new_id;
-                               DEG_id_tag_update_ex(id_remap_data->bmain, id_self, DEG_TAG_TRANSFORM | DEG_TAG_TIME | DEG_TAG_GEOMETRY);
+                               DEG_id_tag_update_ex(id_remap_data->bmain, id_self,
+                                                    DEG_TAG_COPY_ON_WRITE | DEG_TAG_TRANSFORM | DEG_TAG_GEOMETRY);
                        }
                        if (cb_flag & IDWALK_CB_USER) {
                                id_us_min(old_id);