mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed potential race condition
This commit is contained in:
parent
c0a5d1ccf0
commit
bb58d349cb
@ -49,10 +49,10 @@ CondSh<BattleAction *> CBattleInterface::givenCommand(nullptr);
|
||||
|
||||
static void onAnimationFinished(const CStack *stack, std::weak_ptr<CCreatureAnimation> anim)
|
||||
{
|
||||
if(anim.expired())
|
||||
std::shared_ptr<CCreatureAnimation> animation = anim.lock();
|
||||
if(!animation)
|
||||
return;
|
||||
|
||||
std::shared_ptr<CCreatureAnimation> animation = anim.lock();
|
||||
if (animation->isIdle())
|
||||
{
|
||||
const CCreature *creature = stack->getCreature();
|
||||
|
Loading…
Reference in New Issue
Block a user