diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs index f72ad28600..1cb948e802 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs @@ -136,6 +136,7 @@ public sealed class BSTerrainHeightmap : BSTerrainPhys // Frees both the body and the shape. m_physicsScene.PE.DestroyObject(m_physicsScene.World, m_mapInfo.terrainBody); } + m_mapInfo.Release(); } m_mapInfo = null; } diff --git a/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs b/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs index 308769b3d0..9f4f4a6130 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Runtime.InteropServices; using OMV = OpenMetaverse; namespace OpenSim.Region.PhysicsModule.BulletS @@ -169,7 +170,7 @@ public class BulletHMapInfo public BulletHMapInfo(uint id, float[] hm, float pSizeX, float pSizeY) { ID = id; heightMap = hm; - terrainRegionBase = OMV.Vector3.Zero; + heightMapHandle = GCHandle.Alloc(heightMap, GCHandleType.Pinned); minCoords = new OMV.Vector3(100f, 100f, 25f); maxCoords = new OMV.Vector3(101f, 101f, 26f); minZ = maxZ = 0f; @@ -185,6 +186,13 @@ public class BulletHMapInfo public float minZ, maxZ; public BulletShape terrainShape; public BulletBody terrainBody; + private GCHandle heightMapHandle; + + public void Release() + { + if(heightMapHandle.IsAllocated) + heightMapHandle.Free(); + } } // The general class of collsion object. diff --git a/bin/OpenSim32.pdb b/bin/OpenSim32.pdb deleted file mode 100644 index 86d3058531..0000000000 Binary files a/bin/OpenSim32.pdb and /dev/null differ