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

Capture members by copy instead of capturing this due to short lifetime

This commit is contained in:
Ivan Savenko 2024-04-16 18:55:21 +03:00
parent ced0bbe526
commit 2861ebb515

View File

@ -729,7 +729,7 @@ void BattleInterface::requestAutofightingAIToTakeAction()
// FIXME: unsafe
// Run task in separate thread to avoid UI lock while AI is making turn (which might take some time)
// HOWEVER this thread won't atttempt to lock game state, potentially leading to races
boost::thread aiThread([this, activeStack]()
boost::thread aiThread([battleID = this->battleID, curInt = this->curInt, activeStack]()
{
setThreadName("autofightingAI");
curInt->autofightingAI->activeStack(battleID, activeStack);