diff options
Diffstat (limited to 'src/settings.cpp')
-rw-r--r-- | src/settings.cpp | 12 |
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) { |