From fec65b3c698540fa93e877b365b051f98c277ff7 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 9 Feb 2008 04:08:26 +0000 Subject: * Tweaked timing of rapid mesh requests. Helps a race condition. --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index aa80a84..52a975e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -389,6 +389,7 @@ namespace OpenSim.Region.Physics.OdePlugin { disableBody(); } + System.Threading.Thread.Sleep(10); float[] vertexList = mesh.getVertexListAsFloatLocked(); // Note, that vertextList is pinned in memory int[] indexList = mesh.getIndexListAsIntLocked(); // Also pinned, needs release after usage int VertexCount = vertexList.GetLength(0)/3; @@ -400,9 +401,19 @@ namespace OpenSim.Region.Physics.OdePlugin 3*sizeof (int)); d.GeomTriMeshDataPreprocess(_triMeshData); + _parent_scene.waitForSpaceUnlock(m_targetSpace); - prim_geom = d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null); - + + try + { + prim_geom = d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null); + } + catch (System.AccessViolationException) + { + + m_log.Error("MESH LOCKED"); + return; + } if (IsPhysical && Body == (IntPtr) 0) { // Recreate the body -- cgit v1.1