mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Fix crash on shutdown
StopAllMacros was called before th->wait(), allowing Macro::Stop() to run concurrently with the other threads still inside CheckConditions. This caused races on _conditionCheckFuture (called from both threads) and _helperThreads. This could happen if conditions / actions were marked to run in parallel to the main loop.
This commit is contained in:
@@ -1316,7 +1316,14 @@ bool RunMacros()
|
||||
return true;
|
||||
}
|
||||
|
||||
void StopAllMacros()
|
||||
void SignalStopAllMacros()
|
||||
{
|
||||
for (const auto &m : GetAllMacros()) {
|
||||
m->SignalStop();
|
||||
}
|
||||
}
|
||||
|
||||
void WaitForAllMacros()
|
||||
{
|
||||
for (const auto &m : GetAllMacros()) {
|
||||
m->Stop();
|
||||
|
||||
Reference in New Issue
Block a user