mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-24 14:58:19 -05:00
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:
parent
a740a29798
commit
234ae27205
|
|
@ -3,6 +3,7 @@
|
|||
#include "macro-helpers.hpp"
|
||||
#include "macro-properties.hpp"
|
||||
#include "macro.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "section.hpp"
|
||||
#include "switch-button.hpp"
|
||||
|
||||
|
|
@ -88,6 +89,7 @@ void MacroActionEdit::ActionSelectionChanged(const QString &text)
|
|||
*_entryData = MacroActionFactory::Create(id, macro);
|
||||
(*_entryData)->SetIndex(idx);
|
||||
(*_entryData)->PostLoad();
|
||||
RunPostLoadSteps();
|
||||
}
|
||||
auto widget = MacroActionFactory::CreateWidget(id, this, *_entryData);
|
||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||
|
|
@ -185,9 +187,10 @@ void AdvSceneSwitcher::AddMacroAction(int idx)
|
|||
auto data = obs_data_create();
|
||||
macro->Actions().at(idx - 1)->Save(data);
|
||||
macro->Actions().at(idx)->Load(data);
|
||||
macro->Actions().at(idx)->PostLoad();
|
||||
obs_data_release(data);
|
||||
}
|
||||
macro->Actions().at(idx)->PostLoad();
|
||||
RunPostLoadSteps();
|
||||
macro->UpdateActionIndices();
|
||||
ui->actionsList->Insert(
|
||||
idx,
|
||||
|
|
@ -475,6 +478,7 @@ void AdvSceneSwitcher::AddMacroElseAction(int idx)
|
|||
macro->ElseActions().at(idx)->Load(data);
|
||||
}
|
||||
macro->ElseActions().at(idx)->PostLoad();
|
||||
RunPostLoadSteps();
|
||||
macro->UpdateElseActionIndices();
|
||||
ui->elseActionsList->Insert(
|
||||
idx, new MacroActionEdit(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user