diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-16 18:02:33 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-16 18:02:33 +0100 |
commit | 6e8b3cbc0f124d9543f9f4e1bbcdb97a2477dda0 (patch) | |
tree | 7cf063822c8a02b9ecdc51545eddfab843b4a9fa /src/ft_exit.c | |
parent | 3,000,000 bytes leaked xd fuck heap (diff) | |
download | 42-cub3d-6e8b3cbc0f124d9543f9f4e1bbcdb97a2477dda0.tar.gz 42-cub3d-6e8b3cbc0f124d9543f9f4e1bbcdb97a2477dda0.tar.bz2 42-cub3d-6e8b3cbc0f124d9543f9f4e1bbcdb97a2477dda0.tar.xz 42-cub3d-6e8b3cbc0f124d9543f9f4e1bbcdb97a2477dda0.tar.zst 42-cub3d-6e8b3cbc0f124d9543f9f4e1bbcdb97a2477dda0.zip |
On the way
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r-- | src/ft_exit.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index b2ccd69..d135433 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -21,10 +21,23 @@ #include <stdint.h> static void - ft_free_lists(t_cub *clist) +ft_free_some_extras(t_cub *clist) { uint8_t i; + i = 0; + while (i < 8) + { + ft_memdel((void**)&clist->sprites[i]); + i++; + } + ft_memdel((void**)&clist->sprites); + ft_memdel((void**)&clist); +} + +static void + ft_free_lists(t_cub *clist) +{ ft_memdel((void**)&clist->mlist.filename); ft_memdel((void**)&clist->mlist.no_tex_path); ft_memdel((void**)&clist->mlist.so_tex_path); @@ -49,14 +62,6 @@ 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); } static void @@ -119,6 +124,7 @@ int } ft_kill_forks(clist); ft_free_lists(clist); + ft_free_some_extras(clist); ft_printf("Exiting program\n"); exit(exit_code); return (0); |