Re: [Fwd: Need Help using GLib -> GList]
- From: Tristan Van Berkom <tristan van berkom gmail com>
- To: Jerry DeLisle <jvdelisle verizon net>
- Cc: gtk-list gnome org
- Subject: Re: [Fwd: Need Help using GLib -> GList]
- Date: Sun, 03 Apr 2005 22:42:02 -0400
Jerry DeLisle wrote:
[...]
Can anyone give me some hints?
Dont allocate the GList's yourself, just pass NULL as the
list head for `hand' (no need to have a dataless list element).
And while looping through items always use a list
pointer besides your list head, i.e.:
GList *list, *l;
if ((list = create_list ()) != NULL) {
l = list;
while (l && l->data) {
/* Use iterator */
l = l->next;
}
/* free list head */
g_list_free (list);
}
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]