Re: whos to free what mem?



On Wed, 2004-05-05 at 14:13, James M. Cape wrote:

Yes. blah_set_X() will always copy the given property value into the
object. The arguments to blah_new() merely set those properties before
you get the object.

* Is this true for all the string handling in GTK? Are strings always
copied, and I always need to free them? Or are there exceptions? If so
is there documentation who needs to free what where and when? (;

The API docs *usually* mention when you have to free and when you don't
(e.g. "you must free the returned X when no longer needed"). Further,
the functions return const when you shouldn't mess with the result, and
have const arguments when the object won't mess with the passed values.
The only exception to this rule I'm aware of is char** arrays.

http://developer.gnome.org/doc/API/2.4/gtk/gtk-question-index.html#id2505171

Thanks James and Peter for the quick and helpful answers!

best regards,
Andreas

-- 




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