diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-07 08:48:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-07 08:48:25 +0300 |
commit | fd43b7077fafb47a96d2dbd8c0b3f94513a3b5b5 (patch) | |
tree | c02d4b324c489515de6f396b75afd412109713e6 /source/blender | |
parent | 003365df0e13c19aa53ddf40e6e556c3b6dcfe2e (diff) |
Fix memory leak switching sculpt mode + dyntopo
Auto-enabling dyntopo w/ mode switching leaked memory when undo was used.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 0931456058d..cc7531b9783 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -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, |