* Copy/SpaceBorder Fix attempt number 3, hopefully the last

afrisby
Teravus Ovares 2007-11-18 20:45:47 +00:00
parent 3bb4cd51fd
commit 694bab9513
1 changed files with 21 additions and 11 deletions

View File

@ -420,6 +420,10 @@ namespace OpenSim.Region.Physics.OdePlugin
//If there are no more geometries in the sub-space, we don't need it in the main space anymore //If there are no more geometries in the sub-space, we don't need it in the main space anymore
if (d.SpaceGetNumGeoms(((OdePrim)prim).m_targetSpace) == 0) if (d.SpaceGetNumGeoms(((OdePrim)prim).m_targetSpace) == 0)
{
if (!(((OdePrim)prim).m_targetSpace.Equals(null)))
{
if (d.GeomIsSpace(((OdePrim)prim).m_targetSpace))
{ {
d.SpaceRemove(space, ((OdePrim)prim).m_targetSpace); d.SpaceRemove(space, ((OdePrim)prim).m_targetSpace);
// free up memory used by the space. // free up memory used by the space.
@ -427,6 +431,8 @@ namespace OpenSim.Region.Physics.OdePlugin
resetSpaceArrayItemToZero(calculateSpaceArrayItemFromPos(((OdePrim)prim).Position)); resetSpaceArrayItemToZero(calculateSpaceArrayItemFromPos(((OdePrim)prim).Position));
} }
} }
}
}
d.GeomDestroy(((OdePrim)prim).prim_geom); d.GeomDestroy(((OdePrim)prim).prim_geom);
@ -461,7 +467,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
if (d.SpaceQuery(currentspace, geom) && currentspace != (IntPtr)0) if (d.SpaceQuery(currentspace, geom) && currentspace != (IntPtr)0)
{ {
if (d.GeomIsSpace(currentspace))
d.SpaceRemove(currentspace, geom); d.SpaceRemove(currentspace, geom);
} }
else else
@ -480,6 +486,8 @@ namespace OpenSim.Region.Physics.OdePlugin
if (d.SpaceGetNumGeoms(currentspace) == 0) if (d.SpaceGetNumGeoms(currentspace) == 0)
{ {
if (currentspace != (IntPtr)0) if (currentspace != (IntPtr)0)
{
if (d.GeomIsSpace(currentspace))
{ {
d.SpaceRemove(space, currentspace); d.SpaceRemove(space, currentspace);
// free up memory used by the space. // free up memory used by the space.
@ -488,6 +496,7 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
} }
} }
}
else else
{ {
// this is a physical object that got disabled. ;.; // this is a physical object that got disabled. ;.;
@ -503,6 +512,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
if (sGeomIsIn != (IntPtr)0) if (sGeomIsIn != (IntPtr)0)
{ {
if (d.GeomIsSpace(sGeomIsIn))
d.SpaceRemove(sGeomIsIn, geom); d.SpaceRemove(sGeomIsIn, geom);
} }
} }