From 73efb1633f61d9ad01ee58ae3e2704283a57ed52 Mon Sep 17 00:00:00 2001 From: dahlia Date: Sun, 3 May 2015 19:54:03 -0700 Subject: lock collision mesh cache when accessing --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 24983ab..42231b5 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -928,8 +928,11 @@ namespace OpenSim.Region.Physics.Meshing if (shouldCache) { key = primShape.GetMeshKey(size, lod); - if (m_uniqueMeshes.TryGetValue(key, out mesh)) - return mesh; + lock (m_uniqueMeshes) + { + if (m_uniqueMeshes.TryGetValue(key, out mesh)) + return mesh; + } } if (size.X < 0.01f) size.X = 0.01f; @@ -955,7 +958,10 @@ namespace OpenSim.Region.Physics.Meshing if (shouldCache) { - m_uniqueMeshes.Add(key, mesh); + lock (m_uniqueMeshes) + { + m_uniqueMeshes.Add(key, mesh); + } } } -- cgit v1.1