mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 22:44:54 +00:00
fix memory leak in config::merge_children
remove unused function detach_children
This commit is contained in:
parent
efff6c5c77
commit
70a0145bd1
@ -71,7 +71,7 @@ void config::merge_children(const std::string& key)
|
||||
merged_children.append(**i);
|
||||
}
|
||||
|
||||
detach_children(key);
|
||||
clear_children(key);
|
||||
add_child(key,merged_children);
|
||||
}
|
||||
|
||||
@ -188,12 +188,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
void config::detach_children(const std::string& key)
|
||||
{
|
||||
ordered_children.erase(std::remove_if(ordered_children.begin(),ordered_children.end(),remove_ordered(key)),ordered_children.end());
|
||||
children.erase(key);
|
||||
}
|
||||
|
||||
void config::clear_children(const std::string& key)
|
||||
{
|
||||
ordered_children.erase(std::remove_if(ordered_children.begin(),ordered_children.end(),remove_ordered(key)),ordered_children.end());
|
||||
|
@ -151,9 +151,6 @@ public:
|
||||
string_map values;
|
||||
|
||||
private:
|
||||
//detach child nodes without deleting them (eg. for moving)
|
||||
void detach_children(const std::string& key);
|
||||
|
||||
//a list of all children of this node.
|
||||
child_map children;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user