[MPlayer-cvslog] r36053 - trunk/gui/dialog/fileselect.c

ib subversion at mplayerhq.hu
Sun Mar 24 15:16:34 CET 2013


Author: ib
Date: Sun Mar 24 15:16:34 2013
New Revision: 36053

Log:
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.

Modified:
   trunk/gui/dialog/fileselect.c

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Sun Mar 24 14:08:12 2013	(r36052)
+++ trunk/gui/dialog/fileselect.c	Sun Mar 24 15:16:34 2013	(r36053)
@@ -506,6 +506,12 @@ static gboolean fs_fsFNameList_event( Gt
 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 @@ void ShowFileSelect( int type,int modal 
    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;
 


More information about the MPlayer-cvslog mailing list