Skip to content

Commit

Permalink
Merge pull request #8041 from jordan-woyak/uninit-setting-value-fix
Browse files Browse the repository at this point in the history
InputCommon: Make sure setting values are initialized.
  • Loading branch information
lioncash committed Apr 27, 2019
2 parents 664cfb2 + 9f0dc40 commit 6fec031
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class NumericSetting : public NumericSettingBase
: 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
Expand Down Expand Up @@ -124,7 +125,7 @@ class SettingValue
void SetValue(ValueType value) { m_value = value; }

// Values are R/W by both UI and CPU threads.
std::atomic<ValueType> m_value;
std::atomic<ValueType> m_value = {};
};

} // namespace ControllerEmu

0 comments on commit 6fec031

Please sign in to comment.