My memory tracking system detects memory leak during the following scenario:
- initialize PhysX
- create PxRigidDynamic
- create more than 5 collision shapes using PxPhysics::createShape and attach them to actor with PxRigidActor::attachShape
- add PxRigidDynamic to scene
- simulate()/fetchResults(true) several times
… - simulate()
- remove PxRigidDynamic from scene
- detach and release all shapes from PxRigidDynamic
- release PxRigidDynamic
- fetchResults(true)
… - simulate()/fetchResults(true) several times
… - shutdown PhysX
After shutdown memory leak is detected in file “foundation\include\PsArray.h” line 558.
Interesting observation: if the number of shapes is less than 5, everything is normal.
I’m using PhysX 3.3.1