mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix Settings::remove() always returning true
This commit is contained in:
parent
87291ea44a
commit
b67eab3b00
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue