From a8739ae6c2acbf0737113fbebf7e5ac0a942aaee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 2 Sep 2021 15:39:52 +1000 Subject: Fix regression in recent change 0708733c46cb6b50697c1b80a6541d6fb410267e Adding a mirror modifier in edit-mode crashed. Freeing meshes that hold a shallow copy happens in multiple places while calculating modifiers, making it impractical to clear the edit-mode pointer before freeing the mesh (as done in BKE_editmesh_free_derived_caches). Add a struct member to the edit-mesh struct so evaluated copies don't free the edit-mesh contents. --- source/blender/blenkernel/BKE_editmesh.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/blenkernel/BKE_editmesh.h') diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h index ffd8ac42c63..2c24b1a5487 100644 --- a/source/blender/blenkernel/BKE_editmesh.h +++ b/source/blender/blenkernel/BKE_editmesh.h @@ -78,6 +78,11 @@ typedef struct BMEditMesh { /** Temp variables for x-mirror editing (-1 when the layer does not exist). */ int mirror_cdlayer; + /** + * Enable for evaluated copies, causes the edit-mesh to free the memory, not it's contents. + */ + char is_shallow_copy; + /** * ID data is older than edit-mode data. * Set #Main.is_memfile_undo_flush_needed when enabling. -- cgit v1.2.3