Hi,

I'm using xercesc 2.7.0 on a AIX 5.2 box and I'm wondering if the parse
function has a memory leak. Below you can see the function I'm using -
returns DOMDocument*
XMLPlatformUtils::Initialize() is called in the constructor and
XMLPlatformUtils::Terminate() in the destructor of the class.

Also, I stepped through the code and the only increase in memory I can see
is when calling the parse function. I release the parser delete all objects,
but still no luck.


All suggestions are appreciated.

Thanks
Richard


------------------------------
------------------------------------------------------------------------
DOMBuilder * parser = NULL;
DOMImplementation * impl =
DOMImplementationRegistry::getDOMImplementation(tmpStr);
parser = impl->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS,
NULL);

parser->setFeature(XMLUni::fgDOMNamespaces, true);
parser->setFeature(XMLUni::fgDOMValidation, true);


parser->setErrorHandler(errHdl);
parser->setEntityResolver(entRes);
parser->resetDocumentPool();
errHdl->resetErrors();

DOMDocument* xmlDoc;

MemBufInputSource* memBufIS = new MemBufInputSource((const unsigned char
*const)  pStr, strlen(pStr), bufID);

DOMInputSource * inSource = new Wrapper4InputSource(memBufIS);

xmlDoc = parser->parse(*inSource);

delete inSource;


if( errHdl->getHasErrors() )
{
    parser->release();
    return errHdl->getExceptionDOMDocument();
}
else
{
    parser->resetDocumentPool();
    parser->resetCachedGrammarPool();
    parser->release();

    delete parser;
    delete entRes;
    delete errHdl;

    return xmlDoc;
}
------------------------------------------------------------------------------------------------------

Reply via email to