diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 675239244a8..d4045e57e0b 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -460,13 +460,15 @@ void BKE_object_free_derived_caches(Object *ob) ob->data = ob->runtime.mesh_orig; } - if ((ob->runtime.mesh_eval != NULL && ob->runtime.is_mesh_eval_owned)) { - Mesh *mesh_eval = ob->runtime.mesh_eval; - /* Evaluated mesh points to edit mesh, but does not own it. */ - mesh_eval->edit_mesh = NULL; - BKE_mesh_free(mesh_eval); - BKE_libblock_free_data(&mesh_eval->id, false); - MEM_freeN(mesh_eval); + if (ob->runtime.mesh_eval != NULL) { + if (ob->runtime.is_mesh_eval_owned) { + Mesh *mesh_eval = ob->runtime.mesh_eval; + /* Evaluated mesh points to edit mesh, but does not own it. */ + mesh_eval->edit_mesh = NULL; + BKE_mesh_free(mesh_eval); + BKE_libblock_free_data(&mesh_eval->id, false); + MEM_freeN(mesh_eval); + } ob->runtime.mesh_eval = NULL; } if (ob->runtime.mesh_deform_eval != NULL) { |