From ee13e877d77ba62b28b7af510c7cc729987044ce Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 14 Mar 2020 19:34:06 +0100 Subject: Elementary school math into leaks fix --- src/ft_warp_level.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ft_warp_level.c') diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index 69b7b78..56d4d67 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -51,11 +51,12 @@ static void cl->f_rgb = ft_init_rgb(); cl->c_rgb = ft_init_rgb(); cl->rlist = ft_init_s_ray(); - i = -1; - while (++i < 5) + i = 0; + while (i < 5) { mlx_destroy_image(cl->wlist.wlx, cl->tlist[i].img); - cl->tlist[i].img = NULL; + cl->tlist[i].ptr = NULL; + i++; } if (cl->mlist.isnlvl && cl->tlist[5].img) mlx_destroy_image(cl->wlist.wlx, cl->tlist[5].img); -- cgit v1.2.3