Commit: fd43b7077fafb47a96d2dbd8c0b3f94513a3b5b5
Author: Campbell Barton
Date:   Thu Jul 7 15:48:25 2016 +1000
Branches: master
https://developer.blender.org/rBfd43b7077fafb47a96d2dbd8c0b3f94513a3b5b5

Fix memory leak switching sculpt mode + dyntopo

Auto-enabling dyntopo w/ mode switching leaked memory when undo was used.

===================================================================

M       source/blender/editors/sculpt_paint/sculpt.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 0931456..cc7531b 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,

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to