Fix T90493: Undo a knife-project operation crashes

The crash occurred calling because mesh_get_eval_final in edit-mode
freed all derived mesh data without tagging the object for updating.

However meshes in edit-mode weren't meant to be used as knife-project
source-data, adding support for multi object edit-mode  caused this.
This commit is contained in:
Campbell Barton 2021-08-10 14:37:39 +10:00 committed by Jeroen Bakker
parent 4f7dc4c918
commit bbfb29c794
Notes: blender-bot 2023-02-14 04:40:22 +01:00
Referenced by issue #90493, ASAN: Trying to Undo a knife-project operation causes heap-use-after-free failure
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 4 additions and 2 deletions

View File

@ -130,9 +130,11 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
LinkNode *polys = NULL;
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
if (ob != obedit) {
polys = knifeproject_poly_from_object(C, scene, ob, polys);
if (BKE_object_is_in_editmode(ob)) {
continue;
}
BLI_assert(ob != obedit);
polys = knifeproject_poly_from_object(C, scene, ob, polys);
}
CTX_DATA_END;