I'm doing the following with TinyXml:
TiXmlDocument doc;
TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );
TiXmlElement* main = new TiXmlElement("main");
TiXmlElement* header = new TiXmlElement("header");
header->SetAttribute("attribute","somevalue");
main->LinkEndChild(header);
// ... Add many more TiXmlElment* to other elements all within "main" element
doc.LinkEndChild(decl);
doc.LinkEndChild(main);
// ... do stuff with doc
// Now I am done with my doc. What memory management happens here?
At the end of my program's execution, will all of the TiXmlElement*
be cleaned up when the doc
goes out of scope? Do I need to walk the doc tree and free up all of the memory myself?