mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 00:05:41 -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:
@@ -461,12 +461,13 @@ void SwitcherData::Stop()
|
||||
SetMacroAbortWait(true);
|
||||
GetMacroWaitCV().notify_all();
|
||||
GetMacroTransitionCV().notify_all();
|
||||
StopAllMacros();
|
||||
SignalStopAllMacros();
|
||||
StopAndClearAllActionQueues();
|
||||
CloseAllInputDialogs();
|
||||
th->wait();
|
||||
delete th;
|
||||
th = nullptr;
|
||||
WaitForAllMacros();
|
||||
RunStopSteps();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user