From 27ac5fa77767bab12f9e00ddc41faeebfb2fb1e2 Mon Sep 17 00:00:00 2001 From: TryTwo Date: Mon, 23 Dec 2024 14:54:26 -0700 Subject: [PATCH] Qt crash fix. Don't store Config::Info variable as a reference. --- Source/Core/DolphinQt/Config/ConfigControls/ConfigBool.h | 8 ++------ .../Core/DolphinQt/Config/ConfigControls/ConfigChoice.h | 8 ++------ .../DolphinQt/Config/ConfigControls/ConfigFloatSlider.h | 8 ++------ .../Core/DolphinQt/Config/ConfigControls/ConfigInteger.h | 8 ++------ Source/Core/DolphinQt/Config/ConfigControls/ConfigRadio.h | 8 ++------ .../Core/DolphinQt/Config/ConfigControls/ConfigSlider.h | 8 ++------ 6 files changed, 12 insertions(+), 36 deletions(-) diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigBool.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigBool.h index 304f1a9b1f..ff093b3768 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigBool.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigBool.h @@ -6,11 +6,7 @@ #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h" -namespace Config -{ -template -class Info; -} +#include "Common/Config/ConfigInfo.h" class ConfigBool final : public ConfigControl { @@ -26,6 +22,6 @@ protected: private: void Update(); - const Config::Info& m_setting; + const Config::Info m_setting; bool m_reverse; }; diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.h index 8134487402..77fc9629fb 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigChoice.h @@ -10,11 +10,7 @@ #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h" -namespace Config -{ -template -class Info; -} +#include "Common/Config/ConfigInfo.h" class ConfigChoice final : public ConfigControl { @@ -48,7 +44,7 @@ protected: private: void Update(int index); - const Config::Info& m_setting; + const Config::Info m_setting; bool m_text_is_data = false; }; diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigFloatSlider.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigFloatSlider.h index f68b018379..4f85e31162 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigFloatSlider.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigFloatSlider.h @@ -6,11 +6,7 @@ #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h" -namespace Config -{ -template -class Info; -} +#include "Common/Config/ConfigInfo.h" // Automatically converts an int slider into a float one. // Do not read the int values or ranges directly from it. @@ -31,5 +27,5 @@ protected: private: float m_minimum; float m_step; - const Config::Info& m_setting; + const Config::Info m_setting; }; diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h index 9a0e718279..cd60ad25db 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h @@ -9,11 +9,7 @@ #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h" -namespace Config -{ -template -class Info; -} +#include "Common/Config/ConfigInfo.h" class ConfigInteger final : public ConfigControl { @@ -29,7 +25,7 @@ protected: void OnConfigChanged() override; private: - const Config::Info& m_setting; + const Config::Info m_setting; }; class ConfigIntegerLabel final : public QLabel diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigRadio.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigRadio.h index c6b0e8835c..b0dbd91416 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigRadio.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigRadio.h @@ -6,11 +6,7 @@ #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipRadioButton.h" -namespace Config -{ -template -class Info; -} +#include "Common/Config/ConfigInfo.h" class ConfigRadioInt final : public ConfigControl { @@ -31,6 +27,6 @@ protected: private: void Update(); - const Config::Info& m_setting; + const Config::Info m_setting; int m_value; }; diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h index 7d10dcafb2..3df98d53b7 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h @@ -9,11 +9,7 @@ #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h" -namespace Config -{ -template -class Info; -} +#include "Common/Config/ConfigInfo.h" class ConfigSlider final : public ConfigControl { @@ -29,7 +25,7 @@ protected: void OnConfigChanged() override; private: - const Config::Info& m_setting; + const Config::Info m_setting; }; class ConfigSliderLabel final : public QLabel