Fix attempting to cache widgets of about to be deleted macros

This commit is contained in:
WarmUpTill 2025-06-04 20:07:02 +02:00 committed by WarmUpTill
parent 93703c80bc
commit b17aa30432

View File

@ -207,13 +207,11 @@ void AdvSceneSwitcher::RemoveMacro(std::shared_ptr<Macro> &macro)
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);
}