mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[7247] Fixed memory and data lost at dalayed expire/clear of movement generators.
This commit is contained in:
parent
30c1b87669
commit
6b381f2d0e
2 changed files with 7 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue