From a5edbc8b883ac6fbcf2d7bfded1531d7eaa28841 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Tue, 25 May 2021 19:11:11 +0200 Subject: [PATCH] Reset macro counters when stopping the plugin --- src/advanced-scene-switcher.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/advanced-scene-switcher.cpp b/src/advanced-scene-switcher.cpp index 46ab5c1f..f87dea31 100644 --- a/src/advanced-scene-switcher.cpp +++ b/src/advanced-scene-switcher.cpp @@ -379,6 +379,13 @@ void SwitcherData::Start() } } +void ResetMacroCounters() +{ + for (auto &m : switcher->macros) { + m.ResetCount(); + } +} + void SwitcherData::Stop() { if (th && th->isRunning()) { @@ -390,6 +397,7 @@ void SwitcherData::Stop() th = nullptr; writeToStatusFile("Advanced Scene Switcher stopped"); + ResetMacroCounters(); } server.stop();