2009-06-09 04:15:37 UTC
I haven't gone deeper in my debugging but I can definitely say that there is a memory leak being created when calling TinyXPath::xpath_processor::er_compute_xpath() from within S_compute_xpath().
I'm not sure if I am just invoking it wrong but here is an overview of how I use TinyXPath...
// CODE: START
std::string xmlstr;
// xmlstr = some valid XML string
std::string xpathstr;
// xpathstr = some valid xpath string
TiXmlDocument doc;
doc.Parse( xmlstr.str());
if( doc.Error()) return "";
TinyXPath::xpath_processor x( doc.RootElement(), xpathstr );
std::string ret=x.S_compute_xpath().c_str();
return ret;
// CODE: END
Is there any free/delete function I should be calling?
Thanks in advance!
John