mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-09 12:25:17 -04:00
fix a leak: physics heightfield was only destroyed on cell change and not on exit
This commit is contained in:
parent
ff84fbbfa7
commit
e498495589
@ -222,6 +222,14 @@ namespace Physic
|
|||||||
PhysicEngine::~PhysicEngine()
|
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();
|
RigidBodyContainer::iterator rb_it = RigidBodyMap.begin();
|
||||||
for (; rb_it != RigidBodyMap.end(); ++rb_it)
|
for (; rb_it != RigidBodyMap.end(); ++rb_it)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user