Re: Memory Leak?

[email protected] (Jason E. Stewart)
Newsgroups gmane.text.xml.xerces-p.devel
Message-ID <[email protected]>
Chris Cheung <[email protected]> writes:

> my $parser = XML::Xerces::XercesDOMParser->new();
> $parser->setDoNamespaces(1);
> 
> $parser->setValidationScheme($XML::Xerces::AbstractDOMParser::Val_Never);
> 
> $parser->parse("example.xml");
> my $doc = $parser->adoptDocument();

If you just want access to the underlying document I would call
getDocument(). adoptDocument() is if you want to inform the parser
that you are accepting responsibility for the memory of the $doc. So
when you call $parser->resetDocumentPool() it will not free up the
memory for $doc, you must do so using $doc->release().

But this is not the cause of the leak here. Just FYI.

Cheers,
jas.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.