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
This commit is contained in:
Pablo Dobarro 2021-02-26 18:34:41 +01:00
parent fb7751f3e6
commit c0d8a14ae3
1 changed files with 5 additions and 0 deletions

View File

@ -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];