From 3e707c8a71903f1679d5831ee82a5ad19830e7c6 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 1 Mar 2020 22:21:40 +0100 Subject: Better exit --- src/ft_exit.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src') diff --git a/src/ft_exit.c b/src/ft_exit.c index 1c4a1a8..837c6aa 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -33,7 +33,6 @@ static void ft_memdel((void**)&clist->plist); if (!clist->wlist->inited) ft_memdel((void**)&clist->wlist->winptr); - /* ft_memdel((void**)&clist->wlist->wlx); */ ft_memdel((void**)&clist->wlist); ft_memdel((void**)&clist); } @@ -41,9 +40,6 @@ static void int ft_exit(uint8_t exit_code, t_cub *clist) { - /* uint8_t i; */ - - /* i = 0; */ if (clist->walltexgood) { if (clist->tlist[0].img) @@ -56,22 +52,8 @@ int mlx_destroy_image(clist->wlist->wlx, clist->tlist[3].img); if (clist->tlist[4].img) mlx_destroy_image(clist->wlist->wlx, clist->tlist[4].img); - clist->tlist[0].img = NULL; - clist->tlist[1].img = NULL; - clist->tlist[2].img = NULL; - clist->tlist[3].img = NULL; - clist->tlist[4].img = NULL; - clist->tlist[0].ptr = NULL; - clist->tlist[1].ptr = NULL; - clist->tlist[2].ptr = NULL; - clist->tlist[3].ptr = NULL; - clist->tlist[4].ptr = NULL; if (clist->mlist->isnlvl && clist->tlist[5].img) - { mlx_destroy_image(clist->wlist->wlx, clist->tlist[5].img); - clist->tlist[5].img = NULL; - clist->tlist[5].ptr = NULL; - } } if (clist->wlist->inited) { @@ -80,7 +62,6 @@ int } ft_free_lists(clist); ft_printf("Exiting program\n"); - while (1); exit(exit_code); return (0); } -- cgit v1.2.3