diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-02 16:42:53 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-02 16:42:53 +0100 |
commit | 7a1f24cea4b042ced216a1aabb66d6d531c1bf65 (patch) | |
tree | 56f90e24eb67cead445710bec601a88805026943 /src/ft_warp_level.c | |
parent | YES (diff) | |
download | 42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.gz 42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.bz2 42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.xz 42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.tar.zst 42-cub3d-7a1f24cea4b042ced216a1aabb66d6d531c1bf65.zip |
Music no leak
Diffstat (limited to 'src/ft_warp_level.c')
-rw-r--r-- | src/ft_warp_level.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index 9a61484..866bd69 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -16,6 +16,7 @@ #include <stddef.h> #include <stdint.h> #include <mlx.h> +#include <pthread.h> static void ft_del_map(t_map *ml) @@ -28,6 +29,7 @@ static void ft_memdel((void**)&ml->nl_tex_path); ft_memdel((void**)&ml->nlevel_path); ft_memdel((void**)&ml->music_path); + ft_memdel((void**)&ml->music_cmd); ft_memdel((void**)&ml->mapl); ft_free_words(ml->map); ft_memdel((void**)&ml); @@ -57,6 +59,11 @@ static void cl->tlist[i].img = NULL; i++; } + if (cl->mlist->ismusic) + { + pthread_cancel(cl->tid); + pthread_exit(NULL); + } } int8_t |