Undoing masks in dyntopo leaked memory
authorAntony Riakiotakis <kalast@gmail.com>
Wed, 2 Apr 2014 15:25:03 +0000 (18:25 +0300)
committerAntony Riakiotakis <kalast@gmail.com>
Wed, 2 Apr 2014 15:25:03 +0000 (18:25 +0300)
source/blender/editors/sculpt_paint/sculpt_undo.c

index 5adef17c6adae95e10efeb01df6a5e72155bc47d..724e3ff1849872987f850a7f4bbfb0fc55997bb8 100644 (file)
@@ -296,6 +296,9 @@ static void sculpt_undo_bmesh_restore_generic(bContext *C,
                for (i = 0; i < totnode; i++) {
                        BKE_pbvh_node_mark_redraw(nodes[i]);
                }
+
+               if (nodes)
+                       MEM_freeN(nodes);
        }
        else {
                /* A bit lame, but for now just recreate the PBVH. The alternative