42-archive/42sh/src/main/data_exit.c
wescande 40547b1e65 rectif job_control pour :
plus d'affichage en double lorsque qu'on fait jobs
initialisation de toutes les variables
suppression des leaks quand on exit
2017-03-24 12:42:14 +01:00

30 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* data_exit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/24 12:40:41 by wescande ### ########.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);
lexer_destroy(&data->lexer);
parser_destroy(&data->parser);
ft_lstdel(&data->jobc.first_job, &job_free);
ft_save_termios(-1);
ft_free_hash_table();
free_history_list(data_singleton()->line.list_beg);
free(data_singleton());
}