Re: [gdome] Fixes for libxml strings
- From: Gustavo Sverzut Barbieri <Gustavo Barbieri indt org br>
- To: "ext Sameer Oak" <sameer oak airtightnetworks net>, gdome gnome org
- Cc:
- Subject: Re: [gdome] Fixes for libxml strings
- Date: Wed, 29 Mar 2006 06:23:28 -0300
On Wednesday 29 March 2006 00:11, ext Sameer Oak wrote:
> > ... replaced them with gdome_str_mkref_xml(), which will use xmlFree()
> > instead of g_free().
>
> ---
> Was it gdome_str_unref()?
Sorry, I don't understand what you mean.
gdome_str_unref() will call the unref function provided by the
gdome_str_mkref*() functions.
If you use gdome_str_mkref(), no free() on ptr->str.
If you use gdome_str_mkref_own() or gdome_str_mkref_dup(), g_free( ptr->str )
will be used.
If you use gdome_str_mkref_xml(), xmlFree( ptr->str ) will be used.
Yes, they're different because libxml and glib uses different allocator and if
you misuse them you can get things like double-free or memory leaks.
--
Gustavo Sverzut Barbieri
------------------------
Instituto Nokia de Tecnologia - INdT
Jabber: barbieri gmail com
MSN: barbieri gmail com
ICQ#: 17249123
Skype: gsbarbieri
Mobile: +55 (81) 9927 0010
Phone: +1 (347) 624 6296; 08122692 sip stanaphone com
GPG: 0xB640E1A2 @ wwwkeys.pgp.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]