The question is not clear to me. If you're defining xercesElement in the same scope, this thing won't even compile; you'll get a redecleration error.
You don't delete anything, if you haven't allocated it. You use 'delete' in respect to 'new'. In your code snippet, you are just declaring pointers to DOM elements in your document (or to XMLCh string), you are not actually allocating memory for them. Therefore, you don't delete them. -Ozgur Sahoglu On Feb 15, 2008 7:26 PM, Sree Harsha <[EMAIL PROTECTED]> 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... > > Thanks n Regards > Sree Harsha Vardhana S.N > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
