mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-25 02:50:08 +03:00
feature #282: clear the template before re-build
This commit is contained in:
parent
fbc455a219
commit
5b333b98bd
@ -460,6 +460,19 @@ int Template::from_xml(const string &xml_str)
|
||||
return -1;
|
||||
}
|
||||
|
||||
//Clear the template if not empty
|
||||
if (!attributes.empty())
|
||||
{
|
||||
multimap<string,Attribute *>::iterator it;
|
||||
|
||||
for ( it = attributes.begin(); it != attributes.end(); it++)
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
attributes.clear();
|
||||
}
|
||||
|
||||
// Get the <TEMPLATE> element
|
||||
root_element = xmlDocGetRootElement(xml_doc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user