diff --git a/lib/macro/macro-tab.cpp b/lib/macro/macro-tab.cpp index aa6df43b..f8158a79 100644 --- a/lib/macro/macro-tab.cpp +++ b/lib/macro/macro-tab.cpp @@ -207,13 +207,11 @@ void AdvSceneSwitcher::RemoveMacro(std::shared_ptr ¯o) clearWidgetCache(macro.get()); } - // Currently shown macro will always be part of the macros to be - // removed, so, we clear the widgets as they should not be cached - ui->conditionsList->Clear(); - ui->actionsList->Clear(); - ui->elseActionsList->Clear(); - + // Don't cache widgets for about to be deleted macros + MacroSegmentList::SetCachingEnabled(false); ui->macros->Remove(macro); + MacroSegmentList::SetCachingEnabled(!switcher->disableMacroWidgetCache); + emit MacroRemoved(name); }