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

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

 



On Wed, May 13, 2009 at 02:34:35PM +0800, PenT wrote:
> I created a GSList and then free it using g_slist_free (), then I call
> g_slist_length() and it return 1, surprising!
> 
> I thought after g_slist_free (), the GSList should be empty(NULL), why still
> 1 left?

Stop using the invalid pointer that points to the memory freed by
g_slist_free() and your problem will be gone.

There is no way g_slist_free() could change your pointer -- it does not
take a reference to it -- it just frees the list.

Yeti

_______________________________________________
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