From 1439e54fd27eae98ac03f6f03379b19a6b83c4f8 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:48:17 +0100 Subject: [PATCH 1/2] Fix crash when changing Twitch condition type --- plugins/twitch/macro-condition-twitch.cpp | 3 --- plugins/twitch/macro-condition-twitch.hpp | 1 - 2 files changed, 4 deletions(-) diff --git a/plugins/twitch/macro-condition-twitch.cpp b/plugins/twitch/macro-condition-twitch.cpp index 62d820a72..7bf7106e7 100644 --- a/plugins/twitch/macro-condition-twitch.cpp +++ b/plugins/twitch/macro-condition-twitch.cpp @@ -1427,8 +1427,6 @@ MacroConditionTwitchEdit::MacroConditionTwitchEdit( QWidget::connect(_category, SIGNAL(CategoreyChanged(const TwitchCategory &)), this, SLOT(CategoreyChanged(const TwitchCategory &))); - QWidget::connect(this, SIGNAL(TempVarsChanged()), window(), - SIGNAL(SegmentTempVarsChanged())); QWidget::connect(_clearBufferOnMatch, SIGNAL(stateChanged(int)), this, SLOT(ClearBufferOnMatchChanged(int))); @@ -1480,7 +1478,6 @@ void MacroConditionTwitchEdit::ConditionChanged(int idx) _entryData->SetCondition(static_cast( _conditions->itemData(idx).toInt())); SetWidgetVisibility(); - emit TempVarsChanged(); } void MacroConditionTwitchEdit::TwitchTokenChanged(const QString &token) diff --git a/plugins/twitch/macro-condition-twitch.hpp b/plugins/twitch/macro-condition-twitch.hpp index c500591ec..923c9e3ad 100644 --- a/plugins/twitch/macro-condition-twitch.hpp +++ b/plugins/twitch/macro-condition-twitch.hpp @@ -176,7 +176,6 @@ private slots: signals: void HeaderInfoChanged(const QString &); - void TempVarsChanged(); private: void SetWidgetVisibility(); From f359c3433f25038e697d4a3dd6004ef7e0e09979 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:40:45 +0100 Subject: [PATCH 2/2] Fix crash when actions were copied into a action queue The steps added via AddPostLoadStep() from the copy were never executed. Thus they might be invalid when RunPostLoadSteps() is next called. This could result in a crash when a new action or condition is added after e.g. a "Filter" action's TempVariableRef was copied, which adds a PostLoadStep to resolve the macro segment reference. --- lib/queue/action-queue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/queue/action-queue.cpp b/lib/queue/action-queue.cpp index 1a7faafc1..a0cce29a4 100644 --- a/lib/queue/action-queue.cpp +++ b/lib/queue/action-queue.cpp @@ -113,6 +113,7 @@ void ActionQueue::Add(const std::shared_ptr &action) action->Save(data); copy->Load(data); copy->PostLoad(); + RunPostLoadSteps(); copy->ResolveVariablesToFixedValues(); _actions.emplace_back(copy); } else {