[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58463] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: fix [#36234] Dynamic Topology undo crash

Campbell Barton ideasman42 at gmail.com
Sun Jul 21 05:59:25 CEST 2013


Revision: 58463
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58463
Author:   campbellbarton
Date:     2013-07-21 03:59:24 +0000 (Sun, 21 Jul 2013)
Log Message:
-----------
fix [#36234] Dynamic Topology undo crash

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-07-21 03:03:28 UTC (rev 58462)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2013-07-21 03:59:24 UTC (rev 58463)
@@ -4652,14 +4652,19 @@
 		sculptsession_bm_to_me(ob, TRUE);
 	}
 
-	BM_mesh_free(ss->bm);
-
 	/* Clear data */
 	me->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY;
-	ss->bm = NULL;
-	BM_log_free(ss->bm_log);
-	ss->bm_log = NULL;
 
+	/* typically valid but with global-undo they can be NULL, [#36234] */
+	if (ss->bm) {
+		BM_mesh_free(ss->bm);
+		ss->bm = NULL;
+	}
+	if (ss->bm_log) {
+		BM_log_free(ss->bm_log);
+		ss->bm_log = NULL;
+	}
+
 	/* Refresh */
 	sculpt_update_after_dynamic_topology_toggle(C);
 }




More information about the Bf-blender-cvs mailing list