Re: GSList and g_filename_from_uri free memory problem
- From: Stefan Kost <ensonic hora-obscura de>
- To: Colossus <colossus 3000 it>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: GSList and g_filename_from_uri free memory problem
- Date: Thu, 23 Feb 2006 10:28:46 +0100
Hi
Colossus wrote:
Hi,
I have this code:
gchar **array = NULL;:
array = gtk_selection_data_get_uris ( data );
while (array[len])
{
filename = g_filename_from_uri ( array[len] , NULL, NULL );
Files_to_Add = g_slist_prepend ( Files_to_Add , filename );
g_free (filename);
len++;
}
The problem is that when I free filename the GSList data becames
corrupted, but the docs says that g_filename_from_uri returns allocated
memory, so what can I do ? Once I put filename in the GSList I don't
need it anymore. Is filename freed when I call g_slist_free ?
just don't fre the filenames now. Free the filenames when you free the list.
Stefan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]