[7247] Fixed memory and data lost at dalayed expire/clear of movement generators.

This commit is contained in:
VladimirMangos 2009-02-07 23:37:09 +03:00
parent 30c1b87669
commit 6b381f2d0e
2 changed files with 7 additions and 3 deletions

View file

@ -136,7 +136,9 @@ MotionMaster::DelayedClean()
if (empty() || size() == 1)
return;
m_expList = new ExpireList();
if(!m_expList)
m_expList = new ExpireList();
while( !empty() && size() > 1 )
{
MovementGenerator *curr = top();
@ -184,10 +186,12 @@ MotionMaster::DelayedExpire()
curr->Finalize(*i_owner);
pop();
if(!m_expList)
m_expList = new ExpireList();
if( !isStatic(curr) )
m_expList->push_back(curr);
m_expList = new ExpireList();
while( !empty() && top()->GetMovementGeneratorType() == TARGETED_MOTION_TYPE )
{
// Should check if target is still valid? If not valid it will crash.