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

Use capture by value since thread might start after local method returns

This commit is contained in:
Ivan Savenko 2023-07-25 18:50:55 +03:00
parent be3ed014a7
commit 32f7a95e38

View File

@ -727,7 +727,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([&]()
boost::thread aiThread([this, activeStack]()
{
curInt->autofightingAI->activeStack(activeStack);
});