aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_exit.c')
-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);