delete myDocument is enough.

Tinny

Vinodkumar S wrote:

> I have a small doubt in its memory management , let take an example like
> this
> // C++ IDOM - explicit deletion
> IDOM_Document*   myDocument;
> IDOM_Node*       aNode;
> myDocument = IDOM_DOMImplementation::getImplementation()->createDocument();
> aNode = myDocument->createElement("ElementName");
> myDocument->appendChild(aNode);
> delete myDocument;
>
> here do we have to delete aNode after appending it to myDocument, or only
> deletion of myDocument is enough.
>
> Please Clarify me
>
> rgrds
> Vinod
>
>
> -----Original Message-----
> From: Tinny Ng [ mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]
> Sent: Thursday, September 13, 2001 6:24 PM
> To: [EMAIL PROTECTED]
> Subject: Re: IDOM memory management
>
> > So does this mean that the heap will grow unbounded if
> > IDOM_Element::getAttribute is called repeatedly?
>
> Not really.  Normally the getAttribute just return the same text value that
> is
> already saved inside the node.  It doesn't allocate a new memory for the
> XMLCh*
> returned.
>
> Tinny
>
> "Houle, Dennis W" wrote:
>
> > Team Xerces-C,
> > As I understand memory management in IDOM, the IDOM_Document allocates
> heap
> > memory for XMLCh* returned from such methods as IDOM_Element::getAttribute
> > and does not deallocate heap memory until the IDOM_Document destructor is
> > called.
> >
> > So does this mean that the heap will grow unbounded if
> > IDOM_Element::getAttribute is called repeatedly?
> >
> > Thanks much.
> >
> > Dennis W. Houle
> > The Boeing Company
> > (714) 762-0291
> > (714) 762-2253 (fax)
> > [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to