Hello Vladimir!
Try to call
XMLPlatformUtils::Terminate();
in the end of your program
Dmitry
Vladimir Marek
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
cz> cc:
Subject: XercesDOMWrapperParsedSource
memory problem
06/08/2003 05:03
AM
Please respond to
xalan-dev
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