diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2021-02-26 20:34:41 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2021-02-26 21:27:56 +0300 |
commit | c0d8a14ae3466cb97386f950fff9720ebda5ba43 (patch) | |
tree | 4eb7d7d9db568a5ef890b64f4a3290a7329866ca | |
parent | fb7751f3e6c3cc5295c1eb4004e2125ffd4e08de (diff) |
Fix crash with dyntopo on tools that use cached vertex info
Tools can cache data related to the mesh topology for later use. This
data is indexed by vertex index, so it will be invalid after dyntopo
changes the topology during the stroke.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10550
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1b19fa2b976..3a18d7a10de 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5841,6 +5841,11 @@ static void sculpt_topology_update(Sculpt *sd, return; } + /* Free index based vertex info as it will become invalid after modifying the topology during the + * stroke. */ + MEM_SAFE_FREE(ss->vertex_info.boundary); + MEM_SAFE_FREE(ss->vertex_info.connected_component); + PBVHTopologyUpdateMode mode = 0; float location[3]; |