Skip to content

Commit b67eab3

Browse files
committedJan 19, 2016
Fix Settings::remove() always returning true
1 parent 87291ea commit b67eab3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

Diff for: ‎src/settings.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -880,8 +880,14 @@ bool Settings::remove(const std::string &name)
880880
{
881881
MutexAutoLock lock(m_mutex);
882882

883-
delete m_settings[name].group;
884-
return m_settings.erase(name);
883+
std::map<std::string, SettingsEntry>::iterator it = m_settings.find(name);
884+
if (it != m_settings.end()) {
885+
delete it->second.group;
886+
m_settings.erase(it);
887+
return true;
888+
} else {
889+
return false;
890+
}
885891
}
886892

887893

0 commit comments

Comments
 (0)
Please sign in to comment.