}
}
-void mm_file_free_synclyrics_list(GList *synclyrics_list)
+static void __free_synclyrics(gpointer data)
{
- int list_len = 0;
- int idx = 0;
- AvSynclyricsInfo *synclyrics_info = NULL;
+ AvSynclyricsInfo *info = (AvSynclyricsInfo *) data;
- if (synclyrics_list == NULL) {
+ if (!info)
return;
- }
- list_len = g_list_length(synclyrics_list);
- for (idx = 0; idx < list_len; idx++) {
- synclyrics_info = g_list_nth_data(synclyrics_list, idx);
+ mmfile_free(info->lyric_info);
+ mmfile_free(info);
+}
- if (synclyrics_info != NULL) {
- mmfile_free(synclyrics_info->lyric_info);
- mmfile_free(synclyrics_info);
- }
- }
- if (synclyrics_list != NULL) {
- g_list_free(synclyrics_list);
- synclyrics_list = NULL;
- }
+void mm_file_free_synclyrics_list(GList *synclyrics_list)
+{
+ if (!synclyrics_list)
+ return;
- return;
+ g_list_free_full(synclyrics_list, __free_synclyrics);
}