From 5b333b98bde659517729c743d6ec034485204a46 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 29 Jul 2010 20:33:36 +0200 Subject: [PATCH] feature #282: clear the template before re-build --- src/template/Template.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/template/Template.cc b/src/template/Template.cc index 31e300f071..0da76c8965 100644 --- a/src/template/Template.cc +++ b/src/template/Template.cc @@ -460,6 +460,19 @@ int Template::from_xml(const string &xml_str) return -1; } + //Clear the template if not empty + if (!attributes.empty()) + { + multimap::iterator it; + + for ( it = attributes.begin(); it != attributes.end(); it++) + { + delete it->second; + } + + attributes.clear(); + } + // Get the