13
0

Use XMLNode::remove_child_and_delete in Stateful::add_extra_xml

As the node being replaced has been added with XMLNode::add_child_nocopy the
node also needs to be deleted or a memory leak occurs.
This commit is contained in:
Tim Mayberry 2015-11-07 15:26:27 +10:00
parent 4e6cdb4daa
commit a4daf93f2f

View File

@ -69,7 +69,7 @@ Stateful::add_extra_xml (XMLNode& node)
_extra_xml = new XMLNode ("Extra");
}
_extra_xml->remove_nodes (node.name());
_extra_xml->remove_nodes_and_delete (node.name());
_extra_xml->add_child_nocopy (node);
}