mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Attempt to fix some minor memory leaks
This commit is contained in:
parent
94f1ab4da3
commit
c0530921ff
2 changed files with 13 additions and 2 deletions
|
@ -290,8 +290,11 @@ public:
|
|||
// Ensure that the "" item (the hand) always has ToolCapabilities
|
||||
if(def.name == "")
|
||||
assert(def.tool_capabilities != NULL);
|
||||
|
||||
m_item_definitions[def.name] = new ItemDefinition(def);
|
||||
|
||||
if(m_item_definitions.count(def.name) == 0)
|
||||
m_item_definitions[def.name] = new ItemDefinition(def);
|
||||
else
|
||||
*(m_item_definitions[def.name]) = def;
|
||||
|
||||
// Remove conflicting alias if it exists
|
||||
bool alias_removed = (m_aliases.erase(def.name) != 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue