[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-devel
Subject:    Re: g_list_copy
From:       Owen Taylor <otaylor () redhat ! com>
Date:       2001-02-26 14:50:59
[Download RAW message or body]


[ Probably would be better on gtk-list ]

Jeff Franks <jcf@tpg.com.au> writes:

> Hi,
> 
> I have a question about the g_list_copy function. Do you have to free
> the copied list returned by this function. The documentation doesn't
> tell you to but the word 'copy' make me feel like I should! 

But not the data that the list nodes point to.

So, yes, you have to call g_list_free() on the result.

The docs say:

====
Copies a #GList.

Note that this is a "shallow" copy. If the list elements consist of pointers
to data, the pointers are copied but the actual data isn't.
====

I think this fine. I'm don't see how a function could possibly copy
a list without somebody having to free the result.

Regards,
                                        Owen

_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic