You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Vladimir Marek <ma...@printsoft.cz> on 2003/08/06 11:03:05 UTC

XercesDOMWrapperParsedSource memory problem

Hello,

I found that my program is leaking, and after some investigation I found
this minimal testcase:

-- CUT --
using namespace std;

#include <iostream>

#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOM.hpp>

#include <XercesParserLiaison/XercesDOMSupport.hpp>
#include <XercesParserLiaison/XercesParserLiaison.hpp>
#include <XalanTransformer/XercesDOMWrapperParsedSource.hpp>

XALAN_CPP_NAMESPACE_USE
XERCES_CPP_NAMESPACE_USE

void process(
                DOMDocument *input,
                XercesParserLiaison &theParserLiaison,
                XercesDOMSupport &theDOMSupport)
{

        XercesDOMWrapperParsedSource parsedSource
                (input, theParserLiaison, theDOMSupport);

}

int main (int argc, char **argv) {
        XMLPlatformUtils::Initialize();

        DOMImplementation* impl =
                DOMImplementationRegistry::getDOMImplementation
                        (XMLString::transcode("Core"));

        DOMDocument* doc =
                impl->createDocument( 0, XMLString::transcode("root"),
0);

        XercesDOMSupport theDOMSupport;
        XercesParserLiaison theParserLiaison;

        while (1) {
                process (doc, theParserLiaison, theDOMSupport);
        }

        return 0;
}
-- CUT --

Problem is in the function 'process', each construction of
XercesDOMWrapperParsedSource takes some memory, but it's never freed.
Probably I'm missing something, please could you help me a bit ?

PS: I'm not sure if I am at the correct list, if not, would you be so
kind and redirect me ?

Thank you
-- 
	VladimĂ­r Marek