[Bf-blender-cvs] [c0d8a14ae34] master: Fix crash with dyntopo on tools that use cached vertex info

Pablo Dobarro noreply at git.blender.org
Fri Feb 26 19:28:39 CET 2021


Commit: c0d8a14ae3466cb97386f950fff9720ebda5ba43
Author: Pablo Dobarro
Date:   Fri Feb 26 18:34:41 2021 +0100
Branches: master
https://developer.blender.org/rBc0d8a14ae3466cb97386f950fff9720ebda5ba43

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

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

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



More information about the Bf-blender-cvs mailing list