Re: GList
- From: Chris Vine <chris cvine freeserve co uk>
- To: gtk-app-devel-list gnome org
- Cc: HuamiSoft Hubert Sokolowski <h sokolowski huamisoft com>
- Subject: Re: GList
- Date: Thu, 18 Aug 2005 20:17:34 +0100
On Thursday 18 August 2005 08:51, HuamiSoft Hubert Sokolowski wrote:
always when you allocate a memory, you need to free it by your self.
to free a list completely you need to free /data/ by your self if it
points to some memory that you allocated. g_list_remove removes an
element from a list and frees that element (but without freeing /data/).
g_list_remove_link removes an element without freeing it, but also sets
next and prev to NULL.
g_list_delete_link just removes an element without freeing it, but next
and prev still point where they were pointed.
Actually, g_list_delete_link() does free the link element (it calls
_g_list_free_1()). It is g_list_remove_link() which does not.
g_list_remove_link() in effect starts a new list.
To the other poster who said the documentation was quite clear ...
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]