I am having a memory leak with the following code. I am using xerce 2.7.
I am getting a memory leak proportionate to the size of document been
serialized.

Please let me know if I am dong something wrong.

RWCString XMLHelper::serializeDocument(DOMDocument *doc)
{
        DOMWriter*      writer = 0;
        XMLCh* result = 0;
        XMLPlatformUtils::Initialize();

        if (!doc)
                return RWCString();

        writer = ((DOMImplementationLS*)m_impl)->createDOMWriter();
        result = writer->writeToString(*(DOMNode*)doc->getDocumentElement());
        RWCString tempStr = XMLString::transcode(result);       
               XMLString::release(&result); 
        writer->release();
        
                XMLPlatformUtils::Terminate();
        return result;
        }
    

}
-- 
View this message in context: 
http://www.nabble.com/memroy-leak-tf3411440.html#a9505113
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.

Reply via email to