Skip to content

Commit

Permalink
InputCommon: Make sure setting values are initialized in case they ar…
Browse files Browse the repository at this point in the history
…e used before config load.
  • Loading branch information
jordan-woyak committed Apr 27, 2019
1 parent 664cfb2 commit 9f0dc40
Showing 1 changed file with 2 additions and 1 deletion.
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 9f0dc40

Please sign in to comment.