From 6f9c5ac5eded2b1583f43c0d7ff369e6f37f1fa2 Mon Sep 17 00:00:00 2001 From: night0721 Date: Mon, 18 Nov 2024 00:25:09 +0000 Subject: [PATCH] Fix quiting with marked files --- ccc.c | 5 ++--- file.c | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ccc.c b/ccc.c index 289fd85..e9a551c 100644 --- a/ccc.c +++ b/ccc.c @@ -459,9 +459,8 @@ void cleanup(void) if (files->length != 0) { arraylist_free(files); } - if (marked->length != 0) { - arraylist_free(marked); - } + free(marked->items); + free(marked); /* Restore old terminal settings */ tcsetattr(STDIN_FILENO, TCSAFLUSH, &oldt); bprintf("\033[2J\033[?1049l\033[?25h"); diff --git a/file.c b/file.c index 07601a6..4846155 100644 --- a/file.c +++ b/file.c @@ -16,7 +16,6 @@ ArrayList *arraylist_init(size_t capacity) void arraylist_free(ArrayList *list) { - /* for (size_t i = 0; i < list->length; i++) { if (list->items[i].name != NULL) free(list->items[i].name); @@ -25,7 +24,6 @@ void arraylist_free(ArrayList *list) if (list->items[i].stats != NULL) free(list->items[i].stats); } - */ free(list->items); free(list); }