aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ft_exit.c9
-rw-r--r--src/ft_init_sprites.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 80fd734..b2ccd69 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -23,6 +23,8 @@
static void
ft_free_lists(t_cub *clist)
{
+ uint8_t i;
+
ft_memdel((void**)&clist->mlist.filename);
ft_memdel((void**)&clist->mlist.no_tex_path);
ft_memdel((void**)&clist->mlist.so_tex_path);
@@ -47,6 +49,13 @@ static void
ft_free_sprites(clist->mlist.sprite_path);
if (!clist->wlist.inited)
ft_memdel((void**)&clist->wlist.winptr);
+ i = 0;
+ while (i < 8)
+ {
+ ft_memdel((void**)clist->sprites[i]);
+ i++;
+ }
+ ft_memdel((void**)&clist->sprites);
ft_memdel((void**)&clist);
}
diff --git a/src/ft_init_sprites.c b/src/ft_init_sprites.c
index 4fa21bf..f39a692 100644
--- a/src/ft_init_sprites.c
+++ b/src/ft_init_sprites.c
@@ -25,7 +25,7 @@ t_sprite
if (!(sprites = (t_sprite**)ft_calloc(8, sizeof(t_sprite*))))
return (NULL);
i = 0;
- while (i < 9)
+ while (i < 8)
{
if (!(sprites[i] = (t_sprite*)ft_calloc(4096, sizeof(t_sprite))))
return (NULL);