mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
BulletSim: fix logic for enabling unmanaged code debug messages.
Free pinned memory when physics engine is unloaded.
This commit is contained in:
@@ -166,7 +166,7 @@ public override BulletWorld Initialize(Vector3 maxPosition, ConfigurationParamet
|
||||
|
||||
// If Debug logging level, enable logging from the unmanaged code
|
||||
m_DebugLogCallbackHandle = null;
|
||||
if (BSScene.m_log.IsDebugEnabled || PhysicsScene.PhysicsLogging.Enabled)
|
||||
if (BSScene.m_log.IsDebugEnabled && PhysicsScene.PhysicsLogging.Enabled)
|
||||
{
|
||||
BSScene.m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", BSScene.LogHeader);
|
||||
if (PhysicsScene.PhysicsLogging.Enabled)
|
||||
@@ -212,6 +212,19 @@ public override void Shutdown(BulletWorld world)
|
||||
{
|
||||
BulletWorldUnman worldu = world as BulletWorldUnman;
|
||||
BSAPICPP.Shutdown2(worldu.ptr);
|
||||
|
||||
if (m_paramsHandle.IsAllocated)
|
||||
{
|
||||
m_paramsHandle.Free();
|
||||
}
|
||||
if (m_collisionArrayPinnedHandle.IsAllocated)
|
||||
{
|
||||
m_collisionArrayPinnedHandle.Free();
|
||||
}
|
||||
if (m_updateArrayPinnedHandle.IsAllocated)
|
||||
{
|
||||
m_updateArrayPinnedHandle.Free();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PushUpdate(BulletBody obj)
|
||||
|
||||
Reference in New Issue
Block a user