diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2019-08-21 08:55:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-21 08:55:03 -0700 |
| commit | 288dd649dac350f2298882e1b73383fc7e956585 (patch) | |
| tree | c3ce1ca7c5ac335300ce5594dd7a7915b382a219 /Source/Core/Common/Config/Layer.cpp | |
| parent | bbae0424a1e9dddda9ac30d69661bf021c598634 (diff) | |
| parent | 48a4b621255c1aeaeaebd3add616fa6c8738f201 (diff) | |
Merge pull request #8273 from CookiePLMonster/config-threading-fixes
Threading fixes for config layers
Diffstat (limited to 'Source/Core/Common/Config/Layer.cpp')
| -rw-r--r-- | Source/Core/Common/Config/Layer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/Common/Config/Layer.cpp b/Source/Core/Common/Config/Layer.cpp index 0e201001be..573c79c04e 100644 --- a/Source/Core/Common/Config/Layer.cpp +++ b/Source/Core/Common/Config/Layer.cpp @@ -46,8 +46,14 @@ bool Layer::Exists(const ConfigLocation& location) const bool Layer::DeleteKey(const ConfigLocation& location) { m_is_dirty = true; - bool had_value = m_map[location].has_value(); - m_map[location].reset(); + bool had_value = false; + const auto iter = m_map.find(location); + if (iter != m_map.end() && iter->second.has_value()) + { + iter->second.reset(); + had_value = true; + } + return had_value; } |
