42-archive/42sh/src/main/data_exit.c
2017-03-20 21:26:02 +01:00

27 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* data_exit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/20 21:25:25 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void data_exit(void)
{
t_data *data;
data = data_singleton();
ft_sstrfree(data->env);
ft_sstrfree(data->local_var);
ft_sstrfree(data->argv);
ft_save_termios(-1);
ft_free_hash_table();
free_history_list(data_singleton()->line.list_beg);
free(data_singleton());
}