From 2861ebb515527ea464d1ef1db24a4c8d01dcedad Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 16 Apr 2024 18:55:21 +0300 Subject: [PATCH] Capture members by copy instead of capturing this due to short lifetime --- client/battle/BattleInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/battle/BattleInterface.cpp b/client/battle/BattleInterface.cpp index d534f0556..29519dc6f 100644 --- a/client/battle/BattleInterface.cpp +++ b/client/battle/BattleInterface.cpp @@ -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);