mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 08:23:51 +00:00
fix memory leak in AISequence
This commit is contained in:
parent
15d946415e
commit
61707694e8
1 changed files with 4 additions and 0 deletions
|
@ -67,7 +67,10 @@ bool MWMechanics::AiSequence::getCombatTarget(std::string &targetActorId) const
|
||||||
void MWMechanics::AiSequence::stopCombat()
|
void MWMechanics::AiSequence::stopCombat()
|
||||||
{
|
{
|
||||||
while (getTypeId() == AiPackage::TypeIdCombat)
|
while (getTypeId() == AiPackage::TypeIdCombat)
|
||||||
|
{
|
||||||
|
delete *mPackages.begin();
|
||||||
mPackages.erase (mPackages.begin());
|
mPackages.erase (mPackages.begin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MWMechanics::AiSequence::isPackageDone() const
|
bool MWMechanics::AiSequence::isPackageDone() const
|
||||||
|
@ -83,6 +86,7 @@ void MWMechanics::AiSequence::execute (const MWWorld::Ptr& actor,float duration)
|
||||||
{
|
{
|
||||||
if (mPackages.front()->execute (actor,duration))
|
if (mPackages.front()->execute (actor,duration))
|
||||||
{
|
{
|
||||||
|
delete *mPackages.begin();
|
||||||
mPackages.erase (mPackages.begin());
|
mPackages.erase (mPackages.begin());
|
||||||
mDone = true;
|
mDone = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue