mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Use capture by value since thread might start after local method returns
This commit is contained in:
parent
be3ed014a7
commit
32f7a95e38
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user