Sree Harsha wrote:
Hi all,
Is it possible to re-use a pointer to a DOMElement* as follows

xercesc::DOMElement*
xercesElement=(xercesc::DOMElement*)Nlist_ProcessIndex->item(0);
const XMLCh* ccharProcessIndex = xercesElement->getTextContent( ) ;
xercesc::DOMElement*
xercesElement=(xercesc::DOMElement*)Nlist_Sequence->item(0);
const XMLCh* ccharSequence= xercesElement->getTextContent( ) ;

will it cause memory leaks?? should i delete or free  (Pointer to
DOMElement*) xercesElement?? will the use of XMLCh* as above cause
memory leaks?? should i free or delete the (Pointer to XMLCh) XMLCh*
variables...

Hi Sree,
both pointers (DOMElement and XMLCh) should not be deleted, as they are owned by the DOMDocument and will be deleted when the document is deleted. Only be sure to delete the char* returned by XMLString::transcode, if you invoke it on the XMLCh* buffer.

Alberto



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

Reply via email to