AndresTraks / BulletSharpPInvoke

.NET wrapper for the Bullet physics library using Platform Invoke

Home Page:http://andrestraks.github.io/BulletSharp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heap corruption when disposing a bullet object

maxilevi opened this issue · comments

Rarely and on some computers on disposing an object the heap gets corrupted. Here is the trace from WinDBG

OS Thread Id: 0x2338 (0)
        Child SP               IP Call Site
000000c19d36e4b0 00007ff94141cc14 [InlinedCallFrame: 000000c19d36e4b0] BulletSharp.UnsafeNativeMethods.btCollisionShape_delete(IntPtr)
000000c19d36e4b0 00007ff8ce413359 [InlinedCallFrame: 000000c19d36e4b0] BulletSharp.UnsafeNativeMethods.btCollisionShape_delete(IntPtr)
000000c19d36e480 00007ff8ce413359 BulletSharp.CollisionShape.Dispose(Boolean)
    PARAMETERS:
        this = <no data>
        disposing = <no data>

000000c19d36e530 00007ff8ce347db0 BulletSharp.BulletDisposableObject.Dispose()
    PARAMETERS:
        this (<CLR reg>) = 0x0000022a21132c00

000000c19d36e560 00007ff8ce4a4b8d *** WARNING: Unable to verify checksum for Hedra.exe
Hedra.Engine.Bullet.BulletPhysics.DisposeBody(BulletSharp.RigidBody) [D:\Project Hedra\Hedra\Engine\Bullet\BulletPhysics.cs @ 459]
    PARAMETERS:

000000c19d36e5b0 00007ff8ce4a4302 Hedra.Engine.Bullet.BulletPhysics.RemoveAndDispose(BulletSharp.RigidBody) [D:\Project Hedra\Hedra\Engine\Bullet\BulletPhysics.cs @ 391]
    PARAMETERS:

000000c19d36e620 00007ff8ce4a5318 Hedra.Engine.WorldBuilding.BaseStructure.Dispose() [D:\Project Hedra\Hedra\Engine\WorldBuilding\BaseStructure.cs @ 88]

Any ideas of what could be causing this?