/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_list_clear.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: whaffman +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/03 15:08:22 by whaffman #+# #+# */ /* Updated: 2024/07/03 15:14:59 by whaffman ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_list.h" void ft_list_clear(t_list *begin_list, void (*free_fct)(void *)) { t_list *next; while (begin_list) { free_fct(begin_list->data); next = begin_list->next; free(begin_list); begin_list = next; } }