Re: [gdome]Buffered additions



Hi Enrico,

>  - Since DOMString::toC() result has to be deallocated by the caller, it
>    should be clearly stated that this (tempting) statement leads to
>    memory leak:
>    printf("Node value: %s\n", node.get_nodeValue().toC());

I agree. As almost all programmers I'm very lazy when it's time to write
documentation...

>  - The documentation talks about a c_str() method, but it does not seem
>    to exist.

That was in an older version...

>  - Not being able to use DOMStrings in printf-like format strings is
>    quite a PITA when you write lots of debugging messages.

in CVS there is already a version where DOMString has a constructor
getting std::string and a toString() conversion method. There are still a
few things to work on, and then we can release the new version.

> However, good news: now that I switched to toUTF8() and corrected all
> these memory leaks, my program is doing fine.

going back to this point, I don't think it was my intention to have the
toC method converting to Latin1, in fact I thought it was going to
UTF8. I'll have to check this.

As the number of messages regarding gmetadom is increasing, I will try to
open a mailing list for it.

Luca





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