Alembic export: fixed memory leak

If the triangulated mesh was in itself a new mesh that should be freed this
should happen before the function returns (as it only returns a single mesh,
and thus the caller can only free one).
This commit is contained in:
Sybren A. Stüvel 2019-01-15 16:14:05 +01:00
parent 2124f3107c
commit 9fed39c7b0
1 changed files with 4 additions and 0 deletions

View File

@ -550,6 +550,10 @@ Mesh *AbcMeshWriter::getFinalMesh(bool &r_needsfree)
Mesh *result = BKE_mesh_from_bmesh_for_eval_nomain(bm, 0);
BM_mesh_free(bm);
if (r_needsfree) {
BKE_id_free(NULL, mesh);
}
mesh = result;
r_needsfree = true;
}