Fix quiting with marked files

This commit is contained in:
Night Kaly 2024-11-18 00:25:09 +00:00
parent c50af43b7b
commit 6f9c5ac5ed
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM
2 changed files with 2 additions and 5 deletions

5
ccc.c
View file

@ -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");

2
file.c
View file

@ -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);
}