Fix Settings::remove() always returning true
parent
87291ea44a
commit
b67eab3b00
|
@ -880,8 +880,14 @@ bool Settings::remove(const std::string &name)
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(m_mutex);
|
MutexAutoLock lock(m_mutex);
|
||||||
|
|
||||||
delete m_settings[name].group;
|
std::map<std::string, SettingsEntry>::iterator it = m_settings.find(name);
|
||||||
return m_settings.erase(name);
|
if (it != m_settings.end()) {
|
||||||
|
delete it->second.group;
|
||||||
|
m_settings.erase(it);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue