aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_exit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index f0a94a3..b9e061f 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -40,7 +40,14 @@ int
ft_exit(uint8_t exit_code, t_cub *clist)
{
if (clist->wlist->inited)
+ {
+ mlx_destroy_image(clist->wlist->wlx, clist->tlist[0].img);
+ mlx_destroy_image(clist->wlist->wlx, clist->tlist[1].img);
+ mlx_destroy_image(clist->wlist->wlx, clist->tlist[2].img);
+ mlx_destroy_image(clist->wlist->wlx, clist->tlist[3].img);
+ mlx_destroy_image(clist->wlist->wlx, clist->tlist[4].img);
mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr);
+ }
ft_free_lists(clist);
ft_printf("Exiting program\n");
exit(exit_code);