[xml] knowing when cur is still valid?



I was perusing the tree documentation, and came across a number of
entries such as this:

<excerpt>
xmlAddChild ()

xmlNodePtr  xmlAddChild                     (xmlNodePtr parent,
                                             xmlNodePtr cur);

Add a new node to parent, at the end of the child (or property) list
merging adjacent TEXT nodes (in which case cur is freed) If the new node
was already inserted in a document it is first unlinked from its
existing context. If the new node is ATTRIBUTE, it is added into
properties instead of children. If there is an attribute with equal
name, it is first destroyed.

parent : the parent node
cur : the child node
Returns : the child or NULL in case of error.
</excerpt>

I've naievely assumed that cur would be an xmlNodePtr I have allocated
and filled-in with everything of interest. If cur is possibly freed by
xmlAddChild, how will I know whether or not it is still OK to access or
free cur?

rick jones
-- 
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to raj in cup.hp.com  but NOT BOTH...



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]