diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-29 22:49:10 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-29 22:49:10 +0100 |
commit | 46538b419624d27d590d981d070b387291e1abc8 (patch) | |
tree | 234b58813339bd10a97f06dd96cf0984d384a0b3 /src/ft_exit.c | |
parent | Debug flags is native (diff) | |
download | 42-cub3d-46538b419624d27d590d981d070b387291e1abc8.tar.gz 42-cub3d-46538b419624d27d590d981d070b387291e1abc8.tar.bz2 42-cub3d-46538b419624d27d590d981d070b387291e1abc8.tar.xz 42-cub3d-46538b419624d27d590d981d070b387291e1abc8.tar.zst 42-cub3d-46538b419624d27d590d981d070b387291e1abc8.zip |
No leak
Diffstat (limited to '')
-rw-r--r-- | src/ft_exit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index 4914803..b2efe2f 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -41,7 +41,7 @@ static void int ft_exit(uint8_t exit_code, t_cub *clist) { - if (clist->wlist->inited) + if (clist->walltexgood) { if (clist->tlist[0].img) mlx_destroy_image(clist->wlist->wlx, clist->tlist[0].img); @@ -55,8 +55,9 @@ int mlx_destroy_image(clist->wlist->wlx, clist->tlist[4].img); if (clist->mlist->isnlvl && clist->tlist[5].img) mlx_destroy_image(clist->wlist->wlx, clist->tlist[5].img); - mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr); } + if (clist->wlist->inited) + mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr); ft_free_lists(clist); ft_printf("Exiting program\n"); exit(exit_code); |