aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-03-01 20:16:08 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-03-01 20:16:08 +0100
commitc17ce9ebac3acbb4879d142ef33b6a8d05fd0aa2 (patch)
treea26b855ed725612ab973d1736f330c24ff9cd91b /src/ft_exit.c
parentMap update again (diff)
download42-cub3d-c17ce9ebac3acbb4879d142ef33b6a8d05fd0aa2.tar.gz
42-cub3d-c17ce9ebac3acbb4879d142ef33b6a8d05fd0aa2.tar.bz2
42-cub3d-c17ce9ebac3acbb4879d142ef33b6a8d05fd0aa2.tar.xz
42-cub3d-c17ce9ebac3acbb4879d142ef33b6a8d05fd0aa2.tar.zst
42-cub3d-c17ce9ebac3acbb4879d142ef33b6a8d05fd0aa2.zip
Better h
Diffstat (limited to '')
-rw-r--r--src/ft_exit.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index b2efe2f..dec46b1 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -53,11 +53,28 @@ 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)
+ {
mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr);
+ clist->wlist->winptr = NULL;
+ }
ft_free_lists(clist);
ft_printf("Exiting program\n");
exit(exit_code);