1
0
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:
Ruben S. Montero 2010-07-29 20:33:36 +02:00
parent fbc455a219
commit 5b333b98bd

View File

@ -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);