xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hichem <hichem...@yahoo.ca>
Subject memroy leak
Date Thu, 15 Mar 2007 22:39:56 GMT

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.

Mime
View raw message