text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_lstclear_bonus.c                                :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: aborboll <aborboll@student.42.fr>          +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2019/11/16 15:49:43 by aborboll          #+#    #+#             */
  /*   Updated: 2020/08/28 17:08:59 by aborboll         ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "../includes/libft.h"
  
  void	ft_lstclear(t_list **lst, void (*del)(void*))
  {
  	t_list	*next;
  	t_list	*new;
  
  	new = *lst;
  	if (new)
  	{
  		while (new)
  		{
  			next = new->next;
  			del(new->content);
  			free(new);
  			new = next;
  		}
  		*lst = NULL;
  	}
  }
  