From 4610ade056855f0e03457857d0f704c6d5b689f2 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Sun, 3 Jun 2012 10:29:41 -0700 Subject: Fix more load/commit memory leaks This fixes some more of the memory leaks in load and commit. Some still exist in the legacy cli_new/cli_parse code. Since that code is supposed to be rewritten such that it interfaces with the rewritten commit code in a clean way, these will not be fixed right now. --- src/cnode/cnode-util.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cnode/cnode-util.hpp') diff --git a/src/cnode/cnode-util.hpp b/src/cnode/cnode-util.hpp index aeeeb08..1b0f042 100644 --- a/src/cnode/cnode-util.hpp +++ b/src/cnode/cnode-util.hpp @@ -27,7 +27,11 @@ public: typedef typename nodes_vec_type::iterator nodes_iter_type; TreeNode() : _parent(0) {} - virtual ~TreeNode() {} + virtual ~TreeNode() { + for ( nodes_iter_type it = _child_nodes.begin(); it != _child_nodes.end(); ++it ) + delete * it; + _child_nodes.clear(); + } const nodes_vec_type& getChildNodes() const { return _child_nodes; } size_t numChildNodes() const { -- cgit v1.2.3