Created
January 19, 2016 09:08
-
-
Save kahrl/3e37088d40f9346196db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/settings.cpp b/src/settings.cpp | |
index e1e01e8..8ea687d 100644 | |
--- a/src/settings.cpp | |
+++ b/src/settings.cpp | |
@@ -880,8 +880,14 @@ bool Settings::remove(const std::string &name) | |
{ | |
MutexAutoLock lock(m_mutex); | |
- delete m_settings[name].group; | |
- return m_settings.erase(name); | |
+ std::map<std::string, SettingsEntry>::iterator it = m_settings.find(name); | |
+ if (it != m_settings.end()) { | |
+ delete it->second.group; | |
+ m_settings.erase(it); | |
+ return true; | |
+ } else { | |
+ return false; | |
+ } | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment