Fix double-free of custom data
authorSybren A. Stüvel <sybren@stuvel.eu>
Wed, 6 Jun 2018 12:37:30 +0000 (14:37 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Wed, 6 Jun 2018 12:38:17 +0000 (14:38 +0200)
This causes a temporary spike in memory usage when creating a copy; the
entire copy will be removed anyway when DerivedMesh is removed.

source/blender/blenkernel/intern/displist.c

index 00ebf558f41d6955546a158a1e4d0f52569a7227..a591ab354f640b96e0c7ea3ea03b9e699e369896 100644 (file)
@@ -1072,7 +1072,7 @@ static void curve_calc_modifiers_post(
                        /* XXX2.8(Sybren): make sure the face normals are recalculated as well */
                        BKE_mesh_ensure_normals(modified);
 
-                       (*r_dm_final) = CDDM_from_mesh(modified);
+                       (*r_dm_final) = CDDM_from_mesh_ex(modified, CD_DUPLICATE, CD_MASK_MESH);
                        BKE_id_free(NULL, modified);
                }
                else {