diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-10-01 01:28:26 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-10-01 01:28:26 +0300 |
commit | 6b9f45c1d1bfafffe6fe251ac7330bc5e5ba8ec2 (patch) | |
tree | b1f8794c1877774a91e3235848af56c01e8b08ea /source/blender | |
parent | 5b0485fd7711494ecc927e97adbeb2655d940af6 (diff) |
Sculpt: Fix T101430: Dyntopo undo crash
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_dyntopo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_dyntopo.c b/source/blender/editors/sculpt_paint/sculpt_dyntopo.c index 2e3834803c9..a524f84cc6e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_dyntopo.c +++ b/source/blender/editors/sculpt_paint/sculpt_dyntopo.c @@ -147,8 +147,13 @@ static void SCULPT_dynamic_topology_disable_ex( SculptSession *ss = ob->sculpt; Mesh *me = ob->data; - BKE_sculpt_attribute_destroy(ob, ss->attrs.dyntopo_node_id_vertex); - BKE_sculpt_attribute_destroy(ob, ss->attrs.dyntopo_node_id_face); + if (ss->attrs.dyntopo_node_id_vertex) { + BKE_sculpt_attribute_destroy(ob, ss->attrs.dyntopo_node_id_vertex); + } + + if (ss->attrs.dyntopo_node_id_face) { + BKE_sculpt_attribute_destroy(ob, ss->attrs.dyntopo_node_id_face); + } SCULPT_pbvh_clear(ob); |