summaryrefslogtreecommitdiff
path: root/libs/pbd/stateful.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-11-07 15:26:27 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-11-10 23:14:17 +1000
commita4daf93f2fad04e04f6634fc9503d92ff6a55b1d (patch)
tree771a959f6c2edf40f0e2d40e1bc2c46740c8215d /libs/pbd/stateful.cc
parent4e6cdb4daa6fb5476854ff238e1cedb7909cd3d4 (diff)
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.
Diffstat (limited to 'libs/pbd/stateful.cc')
-rw-r--r--libs/pbd/stateful.cc2
1 files changed, 1 insertions, 1 deletions
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);
}