From 9f0dc402f44c56de848a295cf8720792f02aa79f Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 27 Apr 2019 07:01:24 -0500 Subject: [PATCH] InputCommon: Make sure setting values are initialized in case they are used before config load. --- Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.h b/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.h index ccc46634ed..108b228049 100644 --- a/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.h +++ b/Source/Core/InputCommon/ControllerEmu/Setting/NumericSetting.h @@ -79,6 +79,7 @@ public: : NumericSettingBase(details), m_value(*value), m_default_value(default_value), m_min_value(min_value), m_max_value(max_value) { + m_value.SetValue(m_default_value); } void LoadFromIni(const IniFile::Section& section, const std::string& group_name) override @@ -124,7 +125,7 @@ private: void SetValue(ValueType value) { m_value = value; } // Values are R/W by both UI and CPU threads. - std::atomic m_value; + std::atomic m_value = {}; }; } // namespace ControllerEmu