* Tweaked timing of rapid mesh requests. Helps a race condition.

ThreadPoolClientBranch
Teravus Ovares 2008-02-09 04:08:26 +00:00
parent d546859bc1
commit fec65b3c69
1 changed files with 13 additions and 2 deletions

View File

@ -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