glist manipulation and reference count



hi,

I am new to GTK and is currently studying the memory management of GTK.

The reference count issue has been nicely described in 
http://www.gtkforums.com/about2412.html

However, one thing that surprised me is that, when I do "g_list_append" or
"g_list_prepend", it does not automatically add the reference count of the
stored GObject (unlike objective-C). 

So do I need to explicitly add the reference count each time the GObject is
inserted? and reduce the reference count when the object is removed? That
seems quite cumbersome to me.

Or can I add some function pointer to generalize this? Is there some kind of
best practice on this?

Tried to Google around, and seems no luck on this.

Any advice is appreciated.

Thanks a lot
-- 
View this message in context: http://www.nabble.com/glist-manipulation-and-reference-count-tp23552925p23552925.html
Sent from the Gtk+ - Dev - General mailing list archive at Nabble.com.



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