Re: Does g_key_file_free() free pointers from g_key_file_get_string()?
- From: Kris Bahnsen <nevrgonastopme00 gmail com>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: gtk-list gnome org
- Subject: Re: Does g_key_file_free() free pointers from g_key_file_get_string()?
- Date: Fri, 17 Jun 2011 08:15:35 -0700
Thank you for all of your info so far.
The only rule to apply is to see if the documentation says whether
ownership is retained by GTK+/glib, or whether an object must be freed
or (in the case of a GObject unrefed). Sometimes the documentation
states this, and sometimes it doesn't. Where it doesn't, it is
necessary to look at the source.
That would be why I am asking here. From what I can tell from the source code, using g_key_file_get_string() returns a pointer to a newly allocated buffer, it looks like that pointer is not registered anywhere, but I do not know the glib internals well enough, I may have missed something. Can anyone confirm that doing a g_key_file_free() does NOT free any pointers retrieved by g_key_file_get_string(), and that those pointers returned by g_key_file_get_string() need to be freed by hand.
] [Thread Prev