From a4bbf1e596a2adea895cd23de70dafca0f6cdea1 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Fri, 27 Mar 2026 22:39:25 +0100 Subject: [PATCH] Don't block UI while running actions --- lib/macro/macro.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 {