It still fails in ~CcdPhysicsController

Jack
Posts: 59
Joined: Thu Aug 31, 2006 11:51 am

It still fails in ~CcdPhysicsController

Post by Jack »

Ver. 2.0f

It fails at:
delete m_MotionState;
in CcdPhysicsController::~CcdPhysicsController()

Library trys to delete something that it does not create.

Imagine the situation:

class ATOM : public PHY_IMotionState
{
CcdPhysicsController *_pPhyCtrl;
}

Destructor of class ATOM executes delete _pPhyCtrl. Destructor of _pPhyCtrl executes delete m_MotionState (that is destructor of ATOM). We are entering into dead loop: ~ATOM calls ~CcdPhysicsController, ~CcdPhysicsController calls ~ATOM.
I think library should not delete objects that it does not create.

P.S. DirectX testbed is not working so far :(:(:(:(:(
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

thanks for pointing it out.

There is a todo, about memory management and reference counting, I will include this too.

See http://www.continuousphysics.com/mediaw ... BulletTodo