@@ -638,14 +638,11 @@ static GSList *wb_project_dir_scan_directory(WB_PROJECT_DIR *root, const gchar *
638638 filelist = gp_filelist_scan_directory_callback
639639 (searchdir , scan_mode_workbench_cb , & params );
640640
641- g_slist_foreach (params .file_patterns_list , (GFunc ) g_pattern_spec_free , NULL );
642- g_slist_free (params .file_patterns_list );
641+ g_slist_free_full (params .file_patterns_list , (GDestroyNotify )g_pattern_spec_free );
643642
644- g_slist_foreach (params .ignored_dirs_list , (GFunc ) g_pattern_spec_free , NULL );
645- g_slist_free (params .ignored_dirs_list );
643+ g_slist_free_full (params .ignored_dirs_list , (GDestroyNotify )g_pattern_spec_free );
646644
647- g_slist_foreach (params .ignored_file_list , (GFunc ) g_pattern_spec_free , NULL );
648- g_slist_free (params .ignored_file_list );
645+ g_slist_free_full (params .ignored_file_list , (GDestroyNotify )g_pattern_spec_free );
649646 }
650647 else
651648 {
@@ -697,8 +694,7 @@ static guint wb_project_dir_rescan_int(WB_PROJECT *prj, WB_PROJECT_DIR *root)
697694 }
698695 }
699696
700- g_slist_foreach (lst , (GFunc ) g_free , NULL );
701- g_slist_free (lst );
697+ g_slist_free_full (lst , g_free );
702698
703699 return filenum ;
704700}
@@ -797,8 +793,7 @@ static void wb_project_dir_add_file_int(WB_PROJECT *prj, WB_PROJECT_DIR *root, c
797793 }
798794 }
799795
800- g_slist_foreach (scanned , (GFunc ) g_free , NULL );
801- g_slist_free (scanned );
796+ g_slist_free_full (scanned , g_free );
802797 }
803798}
804799
0 commit comments