diff --git a/lib/macro/macro.cpp b/lib/macro/macro.cpp index 0e00ab17..cc355e80 100644 --- a/lib/macro/macro.cpp +++ b/lib/macro/macro.cpp @@ -428,10 +428,11 @@ bool Macro::RunActionsHelper( } if (action->Enabled()) { action->LogAction(); - bool actionResult = false; - action->WithLock([&action, &actionResult]() { - actionResult = action->PerformAction(); + std::shared_ptr actionCopy; + action->WithLock([&action, &actionCopy]() { + actionCopy = action->Copy(); }); + bool actionResult = actionCopy->PerformAction(); actionsExecutedSuccessfully = actionsExecutedSuccessfully && actionResult; } else {