Fix memory leak switching sculpt mode + dyntopo

Auto-enabling dyntopo w/ mode switching leaked memory when undo was used.
This commit is contained in:
Campbell Barton 2016-07-07 15:48:25 +10:00
parent 003365df0e
commit fd43b7077f
1 changed files with 3 additions and 0 deletions

View File

@ -5462,7 +5462,10 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
}
if (message_unsupported == NULL) {
/* undo push is needed to prevent memory leak */
sculpt_undo_push_begin("Dynamic topology enable");
sculpt_dynamic_topology_enable(C);
sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_DYNTOPO_BEGIN);
}
else {
BKE_reportf(op->reports, RPT_WARNING,