diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-31 16:06:01 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-31 16:07:15 +0300 |
commit | 72a563cdee8fef198a200ff65b57ddb847c01795 (patch) | |
tree | f5404966b5a23c96178d04ff85f6831969c4c68c /source/blender/bmesh/intern | |
parent | d8dbd49a2f23b7637f05fc058f39bdf6ab706624 (diff) |
Fix bmesh_to_mesh freeing possibly referenced vertices
Fixes Godot exporter issue reported in T65285.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_conv.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index 0ea33049458..7a100167b48 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -611,12 +611,7 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh /* lets save the old verts just in case we are actually working on * a key ... we now do processing of the keys at the end */ - oldverts = me->mvert; - - /* don't free this yet */ - if (oldverts) { - CustomData_set_layer(&me->vdata, CD_MVERT, NULL); - } + oldverts = MEM_dupallocN(me->mvert); /* free custom data */ CustomData_free(&me->vdata, me->totvert); @@ -975,7 +970,7 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh } } - if (oldverts) { + if (oldverts != NULL) { MEM_freeN(oldverts); } |