summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-03-13 04:35:34 +0100
committerShadowNinja <shadowninja@minetest.net>2015-03-18 13:03:02 -0400
commit538036d004f914f31c276090d7735d61139fc58e (patch)
tree6d8d067c49d2c96dfa9469798150a02e0bd594c4 /src/settings.cpp
parent467fc0ddc912ae38c3bf9fcb99e0b66d7478eec0 (diff)
downloadminetest-538036d004f914f31c276090d7735d61139fc58e.tar.gz
minetest-538036d004f914f31c276090d7735d61139fc58e.tar.bz2
minetest-538036d004f914f31c276090d7735d61139fc58e.zip
Fix game minetest.conf default settings
This was a regression introduced by f6e4c5d9cf459e8278a76a2beaee59732e841458 .
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 594b8944d..c1d70714f 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -887,6 +887,11 @@ void Settings::clear()
clearNoLock();
}
+void Settings::clearDefaults()
+{
+ JMutexAutoLock lock(m_mutex);
+ clearDefaultsNoLock();
+}
void Settings::updateValue(const Settings &other, const std::string &name)
{
@@ -958,11 +963,18 @@ void Settings::clearNoLock()
delete it->second.group;
m_settings.clear();
+ clearDefaultsNoLock();
+}
+
+void Settings::clearDefaultsNoLock()
+{
+ std::map<std::string, SettingsEntry>::const_iterator it;
for (it = m_defaults.begin(); it != m_defaults.end(); ++it)
delete it->second.group;
m_defaults.clear();
}
+
void Settings::registerChangedCallback(std::string name,
setting_changed_callback cbf, void *userdata)
{