aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-01-29 16:09:52 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-01-29 16:09:52 +0100
commitbec06f4323a2cb2c0bc1594df797c529a35d41e2 (patch)
treee2dbc17ea4f8ab4485c90da51a18e32e28d01267 /src/ft_exit.c
parentGood for now, I'll continue later (diff)
download42-cub3d-bec06f4323a2cb2c0bc1594df797c529a35d41e2.tar.gz
42-cub3d-bec06f4323a2cb2c0bc1594df797c529a35d41e2.tar.bz2
42-cub3d-bec06f4323a2cb2c0bc1594df797c529a35d41e2.tar.xz
42-cub3d-bec06f4323a2cb2c0bc1594df797c529a35d41e2.tar.zst
42-cub3d-bec06f4323a2cb2c0bc1594df797c529a35d41e2.zip
Got colors
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r--src/ft_exit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index a3ec72d..c445e37 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -1,6 +1,7 @@
#include <libft.h>
#include <cub3d.h>
#include <mlx.h>
+#include <stddef.h>
#include <stdlib.h>
#include <inttypes.h>
@@ -13,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);
@@ -24,7 +25,10 @@ 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_printf("Exiting program\n");
if (exit_code < 0 || exit_code > 0)
ft_printf("Exit code: %hhu\n", exit_code);