Re: GSList and g_filename_from_uri free memory problem



Gaurav Jain wrote:
All your "filenames" can be retrieved and freed by looping through the list:
Something like:
GSList *next_ptr = Files_to_Add;
while (next_ptr != NULL)
{
        g_free(next_ptr->data);  //this frees the filenames
        next_ptr = g_slist_next(next_ptr);
}
g_slist_free(Files_to_Add); //this frees the list


Hum, what about using directly Files_to_Add instead of next_ptr ?

--
Colossus
Xarchiver, a Linux GTK+2 only archive manager - http://xarchiver.sourceforge.net
Cpsed, a Linux OpenGL 3D scene editor - http://cpsed.sourceforge.net
Mizio, a QT proxy hunter scanner tool - http://mizio.sourceforge.net



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