diff options
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r-- | src/ft_exit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index 60e950a..3cd933a 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -39,8 +39,8 @@ static void ft_memdel((void**)&clist->mlist.mapl); ft_free_words(clist->mlist.map); ft_free_words(clist->sfx.death); - ft_free_words(clist->sfx.pain_one); - ft_free_words(clist->sfx.pain_two); + ft_memdel((void**)&clist->sfx.pain_one); + ft_memdel((void**)&clist->sfx.pain_two); ft_free_words(clist->sfx.trap); ft_free_sprites(clist->mlist.sprite_path); if (!clist->wlist.inited) @@ -81,15 +81,13 @@ static void pthread_cancel(clist->mtid); pthread_join(clist->mtid, NULL); } + pthread_cancel(clist->sfx.pain_tid); if (!(tmp = waitpid(clist->sfx.death_pid, NULL, WNOHANG))) kill(clist->sfx.death_pid, SIGTERM); wait(&clist->sfx.death_pid); if (!(tmp = waitpid(clist->sfx.new_lvl_pid, NULL, WNOHANG))) kill(clist->sfx.new_lvl_pid, SIGTERM); wait(&clist->sfx.new_lvl_pid); - if (!(tmp = waitpid(clist->sfx.pain_pid, NULL, WNOHANG))) - kill(clist->sfx.pain_pid, SIGTERM); - wait(&clist->sfx.pain_pid); if (!(tmp = waitpid(clist->sfx.trap_pid, NULL, WNOHANG))) kill(clist->sfx.trap_pid, SIGTERM); wait(&clist->sfx.trap_pid); |