Re: Does g_key_file_free() free pointers from g_key_file_get_string()?



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.

-Kris


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