keep upstream change

This commit is contained in:
Steve Baer
2022-02-01 09:27:42 -08:00
parent 8cbb77d4aa
commit 8545f9e035
+3 -1
View File
@@ -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);