mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-02 14:45:47 -05:00
Fix crash when deleting macro with wait action
Note that this might still not be completely race free but should improve the situation a lot.
This commit is contained in:
@@ -38,10 +38,12 @@ bool MacroActionWait::PerformAction()
|
||||
sleep_duration);
|
||||
|
||||
std::unique_lock<std::mutex> lock(switcher->m);
|
||||
auto r = switcher->cv.wait_for(
|
||||
switcher->abortMacroWait = false;
|
||||
switcher->macroWaitCv.wait_for(
|
||||
lock,
|
||||
std::chrono::milliseconds((long long)(sleep_duration * 1000)));
|
||||
return r == std::cv_status::timeout;
|
||||
std::chrono::milliseconds((long long)(sleep_duration * 1000)),
|
||||
[] { return switcher->abortMacroWait.load(); });
|
||||
return !switcher->abortMacroWait;
|
||||
}
|
||||
|
||||
bool MacroActionWait::Save(obs_data_t *obj)
|
||||
|
||||
Reference in New Issue
Block a user