Page 1 of 1

It still fails in ~CcdPhysicsController

Posted: Sat Sep 23, 2006 10:04 am
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 :(:(:(:(:(

Posted: Sat Sep 23, 2006 3:34 pm
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