diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc index 214d88d1a63..7830e897109 100644 --- a/source/blender/blenkernel/intern/geometry_set.cc +++ b/source/blender/blenkernel/intern/geometry_set.cc @@ -353,7 +353,10 @@ void GeometrySet::replace_mesh(Mesh *mesh, GeometryOwnershipType ownership) this->remove(); return; } - + if (mesh == this->get_mesh_for_read()) { + return; + } + this->remove(); MeshComponent &component = this->get_component_for_write(); component.replace(mesh, ownership); } @@ -364,7 +367,10 @@ void GeometrySet::replace_curve(CurveEval *curve, GeometryOwnershipType ownershi this->remove(); return; } - + if (curve == this->get_curve_for_read()) { + return; + } + this->remove(); CurveComponent &component = this->get_component_for_write(); component.replace(curve, ownership); } @@ -375,7 +381,10 @@ void GeometrySet::replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipTy this->remove(); return; } - + if (pointcloud == this->get_pointcloud_for_read()) { + return; + } + this->remove(); PointCloudComponent &component = this->get_component_for_write(); component.replace(pointcloud, ownership); } @@ -386,7 +395,10 @@ void GeometrySet::replace_volume(Volume *volume, GeometryOwnershipType ownership this->remove(); return; } - + if (volume == this->get_volume_for_read()) { + return; + } + this->remove(); VolumeComponent &component = this->get_component_for_write(); component.replace(volume, ownership); }