From 8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 13 Mar 2020 02:35:49 +0100 Subject: Freed leaks --- src/ft_del_extra_sprites.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/ft_del_extra_sprites.c (limited to 'src/ft_del_extra_sprites.c') diff --git a/src/ft_del_extra_sprites.c b/src/ft_del_extra_sprites.c new file mode 100644 index 0000000..21df608 --- /dev/null +++ b/src/ft_del_extra_sprites.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_key_loop.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/17 20:06:26 by rbousset #+# #+# */ +/* Updated: 2020/02/17 20:06:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include +#include + +void + ft_del_extra_sprites(t_cub *cl) +{ + uint8_t i; + + i = 1; + while ((i + 2) <= cl->mlist.topsp) + { + if (cl->tlist[i + 7].img) + mlx_destroy_image(cl->wlist.wlx, cl->tlist[i + 7].img); + i++; + } +} -- cgit v1.2.3