diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-01-29 23:21:16 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-01-29 23:21:16 +0100 |
commit | 3fe40e249fbad468347b2a0d643b19f1f5f3f524 (patch) | |
tree | f696e53265307a1b15b36c2d72bb6dfbd95a8885 /src/ft_exit.c | |
parent | it's wonderful (diff) | |
download | 42-cub3d-3fe40e249fbad468347b2a0d643b19f1f5f3f524.tar.gz 42-cub3d-3fe40e249fbad468347b2a0d643b19f1f5f3f524.tar.bz2 42-cub3d-3fe40e249fbad468347b2a0d643b19f1f5f3f524.tar.xz 42-cub3d-3fe40e249fbad468347b2a0d643b19f1f5f3f524.tar.zst 42-cub3d-3fe40e249fbad468347b2a0d643b19f1f5f3f524.zip |
I've seen enough
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r-- | src/ft_exit.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index c445e37..8bd8ac0 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -14,8 +14,8 @@ ft_free_lists(t_cub *clist) ft_memdel(clist->we_tex_path); ft_memdel(clist->sprite_path); ft_free_words(clist->map); - /* if (!clist->wlist->inited) */ - ft_memdel(clist->wlist->winptr); + if (!clist->wlist->inited) + ft_memdel(clist->wlist->winptr); ft_memdel(clist->wlist->wlx); ft_memdel(clist->wlist); ft_memdel(clist); @@ -25,14 +25,11 @@ int ft_exit(uint8_t exit_code, t_cub *clist) { if (clist->wlist->inited) - { mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr); - clist->wlist->winptr = NULL; - } + ft_free_lists(clist); ft_printf("Exiting program\n"); if (exit_code < 0 || exit_code > 0) ft_printf("Exit code: %hhu\n", exit_code); - ft_free_lists(clist); exit(exit_code); return (0); } |