You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Troels Rossing <tr...@qualiware.com> on 2001/11/26 11:08:11 UTC

Memory Problems

I uses mostly the functionality in Xerces, and seems to have problems with
XMLPlatform::Initialize and XMLPlatform::Terminate. The problems is that my
application runs in a dll as part of a service on win2000, therefore the dll
is never unloaded. All I do is to parse an XML document into a DOM_Document
class variable. It seems that the document does not free the memory if i
call the shown function muliple times loading a new doc (or the same
multiple times) into the class variable.
If I unload the dll then my memory is released, but it does not work with
just Initialize and Terminate.

Is there a way that I can release the document or in some other way make
sure that I releases all the memory allocated by the Xerces/Xalan.

bool QWDOMParser::LoadDOMDocument(char *File)
{
    DOMParser Parser;
    try
    {
        Parser.parse(File);
        m_LoadDOMDocument = Parser.getDocument();	//load the document into
mem (hpp file)
        m_LoadRootNode = m_LoadDOMDocument.getDocumentElement();
    }
    catch(const SAXException& e)
    {
        return false;
    }
    catch(const XMLException& e)
    {
        return false;
    }
}

Hope someone can help me :-)

regards

Troels Rossing
QualiWare