From 0c2a70e97083fde4dea489c645554ea2683fa01f Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sat, 2 Nov 2024 12:17:41 +0100 Subject: [PATCH] Fix: crash using Edit Minimum Distance operator This fixes two crashes related to freeing the operator data incorrectly and too early. --- source/blender/editors/sculpt_paint/curves_sculpt_ops.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc index 254f9444f4f..6f57b0eef90 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc @@ -1109,7 +1109,7 @@ static int min_distance_edit_modal(bContext *C, wmOperator *op, const wmEvent *e wm->paintcursors = op_data.orig_paintcursors; ED_region_tag_redraw(region); - MEM_freeN(&op_data); + MEM_delete(&op_data); }; switch (event->type) { @@ -1128,8 +1128,8 @@ static int min_distance_edit_modal(bContext *C, wmOperator *op, const wmEvent *e } case LEFTMOUSE: { if (event->val == KM_PRESS) { - finish(); BKE_brush_tag_unsaved_changes(op_data.brush); + finish(); return OPERATOR_FINISHED; } break;