Fix (workaround) memory leak cancelling sculpt mask expand

This commit is contained in:
Brecht Van Lommel 2019-09-29 02:54:00 +02:00
parent 0fd3723b95
commit 860854b07f
1 changed files with 4 additions and 1 deletions

View File

@ -8919,8 +8919,11 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent *
if ((event->type == ESCKEY && event->val == KM_PRESS) ||
(event->type == RIGHTMOUSE && event->val == KM_PRESS)) {
/* Returning OPERATOR_CANCELLED will leak memory due to not finishing
* undo. Better solution could be to make paint_mesh_restore_co work
* for this case. */
sculpt_mask_expand_cancel(C, op);
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
}
if ((event->type == LEFTMOUSE && event->val == KM_RELEASE) ||