Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion opennurbs_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14831,7 +14831,9 @@ bool ON_MeshCache::Transform(
ON_Mesh* mesh = item->m_mesh_sp.get();
if (nullptr == mesh || mesh->IsEmpty())
continue;
if (false == item->m_mesh_sp.unique())
// NOTE: use_count() == 1 is an approximation in multi-threaded environments
// https:// en.cppreference.com/w/cpp/memory/shared_ptr/unique
if (item->m_mesh_sp.use_count() != 1)
{
// make a copy and transform the copy
std::shared_ptr<ON_Mesh>(new ON_Mesh(*mesh)).swap(item->m_mesh_sp);
Expand Down