diff options
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); |