diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 01:02:32 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 01:02:32 +0100 |
commit | 9f35e7fab50809cd74e3bfffff67a81023abc837 (patch) | |
tree | 8ed891643db7c95aa7f72a1bab2a5f02efbbd078 /src/ft_exit.c | |
parent | Looks like I have to pthread this shit (diff) | |
download | 42-cub3d-9f35e7fab50809cd74e3bfffff67a81023abc837.tar.gz 42-cub3d-9f35e7fab50809cd74e3bfffff67a81023abc837.tar.bz2 42-cub3d-9f35e7fab50809cd74e3bfffff67a81023abc837.tar.xz 42-cub3d-9f35e7fab50809cd74e3bfffff67a81023abc837.tar.zst 42-cub3d-9f35e7fab50809cd74e3bfffff67a81023abc837.zip |
I need a macOS
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r-- | src/ft_exit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index f1da643..60e950a 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -38,7 +38,6 @@ static void ft_memdel((void**)&clist->mlist.music_cmd); ft_memdel((void**)&clist->mlist.mapl); ft_free_words(clist->mlist.map); - ft_free_words(clist->mlist.mcmd_words); ft_free_words(clist->sfx.death); ft_free_words(clist->sfx.pain_one); ft_free_words(clist->sfx.pain_two); @@ -77,9 +76,11 @@ static void { pid_t tmp; - if (!(tmp = waitpid(clist->mpid, NULL, WNOHANG))) - kill(clist->mpid, SIGTERM); - wait(&clist->mpid); + if (clist->isoldmus && clist->wlist.inited) + { + pthread_cancel(clist->mtid); + pthread_join(clist->mtid, NULL); + } if (!(tmp = waitpid(clist->sfx.death_pid, NULL, WNOHANG))) kill(clist->sfx.death_pid, SIGTERM); wait(&clist->sfx.death_pid); |