From caa6cc5bc81278f446d852f73422af36c4c846c5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 14 Mar 2020 18:55:43 +0100 Subject: Perfect but leaks --- src/ft_warp_level.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ft_warp_level.c') diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index f4a978d..69b7b78 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -52,11 +52,13 @@ static void cl->c_rgb = ft_init_rgb(); cl->rlist = ft_init_s_ray(); i = -1; - while (++i <= 5) + while (++i < 5) { mlx_destroy_image(cl->wlist.wlx, cl->tlist[i].img); cl->tlist[i].img = NULL; } + if (cl->mlist.isnlvl && cl->tlist[5].img) + mlx_destroy_image(cl->wlist.wlx, cl->tlist[5].img); if (cl->mlist.isftex && cl->tlist[6].img) mlx_destroy_image(cl->wlist.wlx, cl->tlist[6].img); if (cl->mlist.isctex && cl->tlist[7].img) -- cgit v1.2.3