diff options
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index da94eef4917..b80782b51be 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -27,9 +27,6 @@ #include "MEM_guardedalloc.h" -#include "DNA_armature_types.h" -#include "DNA_mesh_types.h" - #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_string.h" @@ -206,24 +203,9 @@ void ED_editors_exit(Main *bmain, bool do_undo_system) * * To reproduce the problem where stale data is used, see: T84920. */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { - if (ob->type == OB_MESH) { - Mesh *me = ob->data; - if (me->edit_mesh) { - EDBM_mesh_free(me->edit_mesh); - MEM_freeN(me->edit_mesh); - me->edit_mesh = NULL; - if (do_undo_system == false) { - DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); - } - } - } - else if (ob->type == OB_ARMATURE) { - bArmature *arm = ob->data; - if (arm->edbo) { - ED_armature_edit_free(ob->data); - if (do_undo_system == false) { - DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); - } + if (ED_object_editmode_free_ex(bmain, ob)) { + if (do_undo_system == false) { + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); } } } |