aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-14 19:34:06 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-14 19:34:06 +0100
commitee13e877d77ba62b28b7af510c7cc729987044ce (patch)
tree0c857982c626c87a9142cdf6d74e731676318433 /src/ft_warp_level.c
parentIn progress (diff)
download42-cub3d-ee13e877d77ba62b28b7af510c7cc729987044ce.tar.gz
42-cub3d-ee13e877d77ba62b28b7af510c7cc729987044ce.tar.bz2
42-cub3d-ee13e877d77ba62b28b7af510c7cc729987044ce.tar.xz
42-cub3d-ee13e877d77ba62b28b7af510c7cc729987044ce.tar.zst
42-cub3d-ee13e877d77ba62b28b7af510c7cc729987044ce.zip
Elementary school math into leaks fix
Diffstat (limited to '')
-rw-r--r--src/ft_warp_level.c7
1 files changed, 4 insertions, 3 deletions
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);