# HG changeset patch # User ib # Date 1364134594 0 # Node ID acec130e2ab2833551661649944be6fe2850e818 # Parent b522bc621d3c276007f2d2eb9ac02a6ece5f3365 Free list and hash table data on widget destruction. This immediately releases the memory and doesn't wait until next widget construction to free old data then. diff -r b522bc621d3c -r acec130e2ab2 gui/dialog/fileselect.c --- a/gui/dialog/fileselect.c Sun Mar 24 13:08:12 2013 +0000 +++ b/gui/dialog/fileselect.c Sun Mar 24 14:16:34 2013 +0000 @@ -506,6 +506,12 @@ static void fs_Destroy( void ) { WidgetDestroy( fsFileSelect, &fsFileSelect ); + + g_hash_table_destroy( fsPathTable ); + + g_list_foreach(fsTopList_items, (GFunc) g_free, NULL); + g_list_free(fsTopList_items); + fsTopList_items = NULL; } static GtkWidget * create_FileSelect( void ) @@ -724,13 +730,8 @@ if ( !dir[0] ) nfree( dir ); } - if ( fsTopList_items ) - { - g_list_foreach(fsTopList_items, (GFunc) g_free, NULL); - g_list_free(fsTopList_items); - fsTopList_items = NULL; - } - if ( fsPathTable ) g_hash_table_destroy( fsPathTable ); fsPathTable=g_hash_table_new_full(g_str_hash, g_str_equal, free, free); + fsPathTable = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); + { unsigned int i, c = 1;