aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-02-20 20:28:21 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-02-20 20:28:21 +0100
commit5b3b8e9076d903d66e1c853c637ba466ffa282a2 (patch)
treeebb0eaf185a2cd48cfe4f6cd075e72968eb34859 /src/ft_exit.c
parentfix wall_textures on map_three (diff)
download42-cub3d-5b3b8e9076d903d66e1c853c637ba466ffa282a2.tar.gz
42-cub3d-5b3b8e9076d903d66e1c853c637ba466ffa282a2.tar.bz2
42-cub3d-5b3b8e9076d903d66e1c853c637ba466ffa282a2.tar.xz
42-cub3d-5b3b8e9076d903d66e1c853c637ba466ffa282a2.tar.zst
42-cub3d-5b3b8e9076d903d66e1c853c637ba466ffa282a2.zip
Freed leaks
Diffstat (limited to 'src/ft_exit.c')
-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);