forked from teamnwah/openmw-tes3coop
fix a leak: physics heightfield was only destroyed on cell change and not on exit
This commit is contained in:
parent
ff84fbbfa7
commit
e498495589
1 changed files with 8 additions and 0 deletions
|
@ -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…
Reference in a new issue