Fix crash when running RunPostLoadSteps()

RunPostLoadSteps() could be called with "stale" post load steps as
RunPostLoadSteps() was never called when a copy of an action or
condition was created
This commit is contained in:
WarmUpTill
2024-03-02 15:06:36 +01:00
committed by WarmUpTill
parent a740a29798
commit 234ae27205
2 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
#include "macro-properties.hpp"
#include "macro.hpp"
#include "path-helpers.hpp"
#include "plugin-state-helpers.hpp"
#include "section.hpp"
#include "ui-helpers.hpp"
#include "utility.hpp"
@@ -254,6 +255,7 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
(*_entryData)->SetIndex(idx);
(*_entryData)->SetLogicType(logic);
(*_entryData)->PostLoad();
RunPostLoadSteps();
}
auto widget =
MacroConditionFactory::CreateWidget(id, this, *_entryData);
@@ -325,6 +327,7 @@ void AdvSceneSwitcher::AddMacroCondition(int idx)
obs_data_release(data);
}
macro->Conditions().at(idx)->PostLoad();
RunPostLoadSteps();
(*cond)->SetLogicType(logic);
macro->UpdateConditionIndices();
ui->conditionsList->Insert(