Re: [xml] Only through experimentation

On 2 Dec 2004, at 13:11, Daniel Veillard wrote:

On Thu, Dec 02, 2004 at 11:46:44AM +0000, Jose Commins wrote:
        Ok, how about "...  including nodes created separately (e.g. with
xmlNewTextChild) that are linked to the document."

  no this just add confusion IMHO.

        I'm only mentioning this because I see that some are using
xmlFreeNodeList et al when they don't have to :o)

  I don't think they do, otherwise you just segfault when you free
the document, fairly easy to spot !


Indeed, I get segfaults too - but as an example, a previous post on this list from someone new to libxml had this:

delete( buffer );

xmlFreeNodeList( cur );

xmlFreeDoc( doc );



See the entry 'xmlFreeNodeList' - that's one example why I think the 'xmlFreeDoc' documentation should point out that *all* linked nodes, including those newly created, are freed from memory.


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