aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-10 10:48:58 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-10 10:48:58 +0100
commitabd20a73b4733a1a8b845f6ff0817ed77e545173 (patch)
tree24e9630c1895c7ba17b0cff8b4061a0cab2cf46f /src/ft_warp_level.c
parentok now (diff)
download42-cub3d-abd20a73b4733a1a8b845f6ff0817ed77e545173.tar.gz
42-cub3d-abd20a73b4733a1a8b845f6ff0817ed77e545173.tar.bz2
42-cub3d-abd20a73b4733a1a8b845f6ff0817ed77e545173.tar.xz
42-cub3d-abd20a73b4733a1a8b845f6ff0817ed77e545173.tar.zst
42-cub3d-abd20a73b4733a1a8b845f6ff0817ed77e545173.zip
Freed multiple leaks
Diffstat (limited to '')
-rw-r--r--src/ft_warp_level.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index 4a02c2b..1f744c2 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -59,13 +59,16 @@ static void
cl->f_rgb = ft_init_rgb();
cl->c_rgb = ft_init_rgb();
cl->rlist = ft_init_s_ray();
- i = 0;
- while (i <= 5)
+ i = -1;
+ while (++i <= 5)
{
mlx_destroy_image(cl->wlist.wlx, cl->tlist[i].img);
cl->tlist[i].img = NULL;
- i++;
}
+ 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)
+ mlx_destroy_image(cl->wlist.wlx, cl->tlist[7].img);
}
static void