Merge branch 'ubitwork' into avination

avinationmerge
Melanie 2012-11-02 10:59:04 +01:00
commit d383bcc0dc
1 changed files with 14 additions and 20 deletions

View File

@ -1057,25 +1057,22 @@ namespace OpenSim.Region.Physics.Meshing
mesh.RefCount++; mesh.RefCount++;
return mesh; return mesh;
} }
}
// try to find a identical mesh on meshs recently released // try to find a identical mesh on meshs recently released
lock (m_uniqueReleasedMeshes) lock (m_uniqueReleasedMeshes)
{
m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
if (mesh != null)
{ {
m_uniqueReleasedMeshes.Remove(key); m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
lock (m_uniqueMeshes) if (mesh != null)
{ {
m_uniqueReleasedMeshes.Remove(key);
try try
{ {
m_uniqueMeshes.Add(key, mesh); m_uniqueMeshes.Add(key, mesh);
} }
catch { } catch { }
mesh.RefCount = 1;
return mesh;
} }
mesh.RefCount = 1;
return mesh;
} }
} }
return null; return null;
@ -1108,25 +1105,22 @@ namespace OpenSim.Region.Physics.Meshing
mesh.RefCount++; mesh.RefCount++;
return mesh; return mesh;
} }
}
// try to find a identical mesh on meshs recently released // try to find a identical mesh on meshs recently released
lock (m_uniqueReleasedMeshes) lock (m_uniqueReleasedMeshes)
{
m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
if (mesh != null)
{ {
m_uniqueReleasedMeshes.Remove(key); m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
lock (m_uniqueMeshes) if (mesh != null)
{ {
m_uniqueReleasedMeshes.Remove(key);
try try
{ {
m_uniqueMeshes.Add(key, mesh); m_uniqueMeshes.Add(key, mesh);
} }
catch { } catch { }
mesh.RefCount = 1;
return mesh;
} }
mesh.RefCount = 1;
return mesh;
} }
} }