Fix #106901: Dangling pointer after freeing mesh runtime data

This lead to a double-free when deleting the mesh runtime
struct after explicitly clearing the derived caches separately.
This commit is contained in:
Hans Goudey
2023-04-13 09:21:10 -04:00
parent 7eee378ecc
commit 1db918f948

View File

@@ -224,6 +224,7 @@ void BKE_mesh_runtime_clear_geometry(Mesh *mesh)
mesh->runtime->subsurf_optimal_display_edges.clear_and_shrink();
if (mesh->runtime->shrinkwrap_data) {
BKE_shrinkwrap_boundary_data_free(mesh->runtime->shrinkwrap_data);
mesh->runtime->shrinkwrap_data = nullptr;
}
}