Hi,

You do not need to release anything if you have not adopted the the document from the parser.

Gareth

Renato Tegon Forti wrote:

Hi All,

I try understanding Memory Manager, see this code:

-----------------------------------------------

std::auto_ptr<XercesDOMParser> pParser(new XercesDOMParser());

try {

pParser->parse(m_strSelectedItemPathName);

}

catch (...) {

return CString("Erro em obter a descrição do projeto.");

}

xercesc_2_6::DOMDocument* pDoc = pParser->getDocument();

DOMElement* pRoot = pDoc->getDocumentElement();

DOMNodeList* pNodeList = pRoot->getElementsByTagName(X("projectdescription"));

CString strMsg;

for ( int i = 0 ; i <= (int)pNodeList->getLength() ; i++ )

{

DOMNode* pNode = pNodeList->item(i);

if(pNode != NULL)

{

strMsg = pNode->getTextContent();

}

}

-----------------------------------------------

My doubt is, I don’t need release: DOMNode* pNode, DOMElement* pRoot and DOMDocument* pDoc.

When I release XercesDOMParser* pParser all others is released together?

How I know when I need release?

Thanks for help.

--

Renato Tegon Forti

[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

--

Trinity Systems - Grupo Nova América


--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to