Fix: Geometry Nodes: dangling pointer in geometry after modifier evaluation

This case probably hasn't been triggered before because we rarely move individual
const-components around between geometry sets. This happened in #113083 in the
optimization when all elements are in the same group.

Pull Request: https://projects.blender.org/blender/blender/pulls/113160
This commit is contained in:
Jacques Lucke
2023-10-02 17:43:22 +02:00
parent 0ed6172833
commit 17f465f775
@@ -568,6 +568,9 @@ static Mesh *modifier_modify_mesh_and_geometry_set(ModifierData *md,
}
mesh_output = mesh_component.release();
}
/* Need to ensure that non-mesh data is also owned by the geometry set. Otherwise it might be
* freed while there is still a reference to it in the geometry. */
geometry_set.ensure_owns_direct_data();
/* Return an empty mesh instead of null. */
if (mesh_output == nullptr) {