diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-02 08:29:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-02 08:30:54 +0300 |
commit | a2f3aca6470b9a7f211ff95c5f3efeb7f62cb9f4 (patch) | |
tree | 70c7512bf0f1ce285ca2b02c782b85760e7eafc4 | |
parent | 19e1b5c1fd61b622382c2cf7d782e99f6cb8c64b (diff) |
Cleanup: remove redundant edit-mesh memory allocation
This memory was only duplicated to satisfy mesh_data_free
which was incorrectly freeing the pointer (but nothing else).
-rw-r--r-- | source/blender/blenkernel/intern/editmesh.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_wrapper.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/editmesh.c b/source/blender/blenkernel/intern/editmesh.c index a925dfa4da8..e178b0c42d0 100644 --- a/source/blender/blenkernel/intern/editmesh.c +++ b/source/blender/blenkernel/intern/editmesh.c @@ -212,12 +212,12 @@ void BKE_editmesh_free_derived_caches(BMEditMesh *em) { if (em->mesh_eval_cage) { Mesh *me = em->mesh_eval_cage; - MEM_SAFE_FREE(me->edit_mesh); + me->edit_mesh = NULL; BKE_id_free(NULL, me); } if (em->mesh_eval_final && em->mesh_eval_final != em->mesh_eval_cage) { Mesh *me = em->mesh_eval_final; - MEM_SAFE_FREE(me->edit_mesh); + me->edit_mesh = NULL; BKE_id_free(NULL, me); } em->mesh_eval_cage = em->mesh_eval_final = NULL; diff --git a/source/blender/blenkernel/intern/mesh_wrapper.c b/source/blender/blenkernel/intern/mesh_wrapper.c index fe6af432314..de7259757bf 100644 --- a/source/blender/blenkernel/intern/mesh_wrapper.c +++ b/source/blender/blenkernel/intern/mesh_wrapper.c @@ -69,7 +69,7 @@ Mesh *BKE_mesh_wrapper_from_editmesh_with_coords(BMEditMesh *em, /* Use edit-mesh directly where possible. */ me->runtime.is_original = true; - me->edit_mesh = MEM_dupallocN(em); + me->edit_mesh = em; /* Make sure, we crash if these are ever used. */ #ifdef DEBUG |