fix a leak: physics heightfield was only destroyed on cell change and not on exit

actorid
scrawl 13 years ago
parent ff84fbbfa7
commit e498495589

@ -222,6 +222,14 @@ namespace Physic
PhysicEngine::~PhysicEngine()
{
HeightFieldContainer::iterator hf_it = mHeightFieldMap.begin();
for (; hf_it != mHeightFieldMap.end(); ++hf_it)
{
dynamicsWorld->removeRigidBody(hf_it->second.mBody);
delete hf_it->second.mShape;
delete hf_it->second.mBody;
}
RigidBodyContainer::iterator rb_it = RigidBodyMap.begin();
for (; rb_it != RigidBodyMap.end(); ++rb_it)
{

Loading…
Cancel
Save