Re: [Fwd: Need Help using GLib -> GList]

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

 



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

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux