From: Minje Ahn Date: Tue, 27 Oct 2020 04:05:18 +0000 (+0900) Subject: Use g_list_free_full() instead X-Git-Tag: submit/tizen/20201103.020205~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=879b8a2e45ecd3e7b41a7bae4e6f9ccef31fa67c;p=platform%2Fcore%2Fmultimedia%2Flibmm-fileinfo.git Use g_list_free_full() instead Change-Id: Icc79163cef871034a2ee33579f61176f1de34e0c Signed-off-by: Minje Ahn --- diff --git a/utils/mm_file_util_tag.c b/utils/mm_file_util_tag.c index b699778..050cf28 100644 --- a/utils/mm_file_util_tag.c +++ b/utils/mm_file_util_tag.c @@ -3537,31 +3537,23 @@ void mm_file_id3tag_restore_content_info(AvFileContentInfo *pInfo) } } -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); }