denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Export .png is broken


From: Richard Shann
Subject: Re: [Denemo-devel] Export .png is broken
Date: Wed, 19 Jan 2011 19:39:00 +0000

On Tue, 2011-01-18 at 15:37 -0600, Jeremiah Benham wrote:
> The function goes through the list deleting the
> unwanted files using g_remove() and then does a g_list_free(). This
> frees up all the data used up by the strings in the list correct?
No, g_list_free() frees the list, regardless of what, if anything the
data is. It does not call g_free() on the data, as it does not know if
they are pointers to g_malloc'd memory or something else, e.g. integers.
see the Note

http://library.gnome.org/devel/glib/2.10/glib-Doubly-Linked-Lists.html#g-list-free

which says

g_list_free ()
void        g_list_free                     (GList *list);

Frees all of the memory used by a GList. The freed elements are returned
to the slice allocator.

Note
If list elements contain dynamically-allocated memory, they should be
freed first.



Richard





reply via email to

[Prev in Thread] Current Thread [Next in Thread]