From a4daf93f2fad04e04f6634fc9503d92ff6a55b1d Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 7 Nov 2015 15:26:27 +1000 Subject: [PATCH] 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. --- libs/pbd/stateful.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index 7d67629191..2cc40ff6a9 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -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); }