Re: double linked list question.



Is there a known problem when removing the first element of a double
linked list (GList)? I am facing a core dump, when I loop the
list (after I have removed the first element), something that is not
happening if I remove the nth element (n != 1).

i think you can assume that there are no such problems GList is such a
fundamental data type in glib and GTK that any such problems would
show themselves all over the place. 

did you do the reassignment of the list pointer after the removal ?

eg.

        GList *list;

        list = g_list_append (list, some_ptr);
        list = g_list_append (list, some_other_ptr);
        g_list_remove (list, some_ptr);

        /* oops. should have been :

           list = g_list_remove (list, some_ptr);
         */


--p




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