diff options
author | dahlia | 2015-05-03 19:54:03 -0700 |
---|---|---|
committer | dahlia | 2015-05-03 19:54:03 -0700 |
commit | 73efb1633f61d9ad01ee58ae3e2704283a57ed52 (patch) | |
tree | 37633d52c498e7e5fd8c8af637681cf7d8e5c411 /OpenSim | |
parent | Make Meshmerizer mesh cache static so it can be shared across class instances (diff) | |
download | opensim-SC-73efb1633f61d9ad01ee58ae3e2704283a57ed52.zip opensim-SC-73efb1633f61d9ad01ee58ae3e2704283a57ed52.tar.gz opensim-SC-73efb1633f61d9ad01ee58ae3e2704283a57ed52.tar.bz2 opensim-SC-73efb1633f61d9ad01ee58ae3e2704283a57ed52.tar.xz |
lock collision mesh cache when accessing
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 12 |
1 files changed, 9 insertions, 3 deletions
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 | |||
928 | if (shouldCache) | 928 | if (shouldCache) |
929 | { | 929 | { |
930 | key = primShape.GetMeshKey(size, lod); | 930 | key = primShape.GetMeshKey(size, lod); |
931 | if (m_uniqueMeshes.TryGetValue(key, out mesh)) | 931 | lock (m_uniqueMeshes) |
932 | return mesh; | 932 | { |
933 | if (m_uniqueMeshes.TryGetValue(key, out mesh)) | ||
934 | return mesh; | ||
935 | } | ||
933 | } | 936 | } |
934 | 937 | ||
935 | if (size.X < 0.01f) size.X = 0.01f; | 938 | if (size.X < 0.01f) size.X = 0.01f; |
@@ -955,7 +958,10 @@ namespace OpenSim.Region.Physics.Meshing | |||
955 | 958 | ||
956 | if (shouldCache) | 959 | if (shouldCache) |
957 | { | 960 | { |
958 | m_uniqueMeshes.Add(key, mesh); | 961 | lock (m_uniqueMeshes) |
962 | { | ||
963 | m_uniqueMeshes.Add(key, mesh); | ||
964 | } | ||
959 | } | 965 | } |
960 | } | 966 | } |
961 | 967 | ||