mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 11:47:41 -05:00
Fix crash while running macro actions
Users could invalidate the actions vector while the actions were executed resulting in a crash.
This commit is contained in:
@@ -276,9 +276,13 @@ void Macro::ResetTimers()
|
||||
}
|
||||
|
||||
bool Macro::RunActionsHelper(
|
||||
const std::deque<std::shared_ptr<MacroAction>> &actions,
|
||||
const std::deque<std::shared_ptr<MacroAction>> &actionsToRun,
|
||||
bool ignorePause)
|
||||
{
|
||||
// Create copy of action list as elements might be removed, inserted, or
|
||||
// reordered while actions are currently being executed.
|
||||
auto actions = actionsToRun;
|
||||
|
||||
bool actionsExecutedSuccessfully = true;
|
||||
for (auto &action : actions) {
|
||||
if (action->Enabled()) {
|
||||
|
||||
Reference in New Issue
Block a user