Re: [xml] [Repost] Backwards compatibility and memory management...



Daniel Veillard wrote:
On Tue, Mar 16, 2004 at 10:16:56AM -0500, Tristan Van Berkom wrote:
[snip]

Daniel >   You may get a warning at runtime if glade is using a
Daniel > deprecated function. Otherwise it should still work.

Thanks,
    I built libxml 2.6.7 this morning and ran some apps,
didn't complain ;-)

Ron > xmlFree(doc) <- Doc is a doc pointer.. xmlFree clears your
Ron > xml pointers, structures, etc.

Ok, I saw "xmlDocFree()" in the API reference for tree.h, but thankyou
for pointing me to "xmlFree()" (which I deduce from your mail is what
I should use) ;-D

But I am still confused about xmlNodeListGetString(), the example
code (doc/example.html) hasn't changed and is quite unclear about
who is responsable for the returned memory location.

Am I correct to assume that "xmlNodeListGetString()" will always
allocate a new string in memory that can safely be freed with "free()" ?
(because this is what the example seems to assume, just seems strange to me)

or does it return a pointer to a private buffer that must be copied
if the user whishes to keep this buffer after xmlFree(doc) ?

Cheers all,
                                            -Tristan





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