Re: Why there's still ONE element left after g_slist_free () ?

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

 



> I thought after g_slist_free (), the GSList should be empty(NULL), why still

When you say "the GSList should be NULL", what do you mean? You have a
GSList* variable that used to point to the list? Do you assign NULL to
that variable yourself? If not, it is not going to become NULL
magically by itself. After the call to g_slist_free(), the variable
just points to freed memory in the heap and should not be used.

This is not any different than complaining that after

char *p = malloc (42); free (p);

p is not NULL and the C library must be buggy.

--tml
_______________________________________________
gtk-list mailing list
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