[easytag] Simplify ET_Free_File_List()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Simplify ET_Free_File_List()
- Date: Tue, 5 Feb 2013 23:23:07 +0000 (UTC)
commit 2b4b5e63087f8a991a227a57f68037d41e2e15a4
Author: David King <amigadave amigadave com>
Date: Tue Feb 5 22:32:50 2013 +0000
Simplify ET_Free_File_List()
Use g_list_free_full().
src/et_core.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/et_core.c b/src/et_core.c
index 125e6ac..b27479d 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -1989,20 +1989,12 @@ gboolean ET_Set_Displayed_File_List (GList *ETFileList)
*/
gboolean ET_Free_File_List (void)
{
- GList *list = NULL;
-
g_return_val_if_fail (ETCore != NULL || ETCore->ETFileList != NULL, FALSE);
- list = g_list_last(ETCore->ETFileList);
- while (list)
- {
- ET_Free_File_List_Item((ET_File *)list->data);
- if (!list->prev) break;
- list = list->prev;
- }
-
- g_list_free(list);
+ g_list_free_full (ETCore->ETFileList,
+ (GDestroyNotify)ET_Free_File_List_Item);
ETCore->ETFileList = NULL;
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]