diff --git a/src/macro-core/macro.cpp b/src/macro-core/macro.cpp index 445241f6..638ba510 100644 --- a/src/macro-core/macro.cpp +++ b/src/macro-core/macro.cpp @@ -276,9 +276,13 @@ void Macro::ResetTimers() } bool Macro::RunActionsHelper( - const std::deque> &actions, + const std::deque> &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()) {