Merge pull request #8041 from jordan-woyak/uninit-setting-value-fix

InputCommon: Make sure setting values are initialized.
This commit is contained in:
Mat M 2019-04-27 08:35:50 -04:00 committed by GitHub
commit 6fec0315ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -79,6 +79,7 @@ public:
: NumericSettingBase(details), m_value(*value), m_default_value(default_value), : NumericSettingBase(details), m_value(*value), m_default_value(default_value),
m_min_value(min_value), m_max_value(max_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 void LoadFromIni(const IniFile::Section& section, const std::string& group_name) override
@ -124,7 +125,7 @@ private:
void SetValue(ValueType value) { m_value = value; } void SetValue(ValueType value) { m_value = value; }
// Values are R/W by both UI and CPU threads. // Values are R/W by both UI and CPU threads.
std::atomic<ValueType> m_value; std::atomic<ValueType> m_value = {};
}; };
} // namespace ControllerEmu } // namespace ControllerEmu