aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-15 01:02:32 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-15 01:02:32 +0100
commit9f35e7fab50809cd74e3bfffff67a81023abc837 (patch)
tree8ed891643db7c95aa7f72a1bab2a5f02efbbd078 /src/ft_exit.c
parentLooks like I have to pthread this shit (diff)
download42-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.c9
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);