1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Merge pull request #661 from jambolo/bug/fix-0003154

Fixed potential race condition
This commit is contained in:
Alexander Shishkin 2020-10-26 01:02:59 +03:00 committed by GitHub
commit dfeb801425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();