mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-09-03 00:17:34 +08:00
keep upstream change
This commit is contained in:
+3
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user