Re: General GTK Question : When to Free, when to unref, etc.



On Fri, 12 Nov 2004 21:53:04 -0500
Setzer- <setzer sm-soft org> wrote:

I'd like to know in which cases should I free char pointers returned
by 
the various GTK functions,
such as gtk_entry_get_text, gtk_tree_model_get, g_locale_from_utf8,
etc.
when a function returns 'const char*' like gtk_entry_get_text then you
don't free, when it returns 'char*' you do.


Likely, when should source pointers be freed, with functions like 
gtk_list_store_set, g_locale_to_utf8, etc.
It isn't always clear what is being done with the stuff.

I've also been told to use ' g_object_unref ', yet I've never heard of

it in the tutorials, or anywhere else.
Is it important to use it? In which cases?
this should be written in the reference when to use g_object_unref.


-- 
Hubert Sokolowski




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