1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-23 22:40:07 +02:00

Fixed CID 1288860

This commit is contained in:
AlexVinS 2016-11-25 16:09:14 +03:00
parent f50fd6d8db
commit 4e28efb8b4

@ -2807,7 +2807,7 @@ void CBattleInterface::requestAutofightingAIToTakeAction()
boost::thread aiThread([&] boost::thread aiThread([&]
{ {
auto ba = new BattleAction(curInt->autofightingAI->activeStack(activeStack)); auto ba = make_unique<BattleAction>(curInt->autofightingAI->activeStack(activeStack));
if (curInt->isAutoFightOn) if (curInt->isAutoFightOn)
{ {
@ -2823,12 +2823,11 @@ void CBattleInterface::requestAutofightingAIToTakeAction()
} }
else else
{ {
givenCommand->setn(ba); givenCommand->setn(ba.release());
} }
} }
else else
{ {
delete ba;
boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim); boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim);
activateStack(); activateStack();
} }