diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 02:15:01 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-15 02:15:01 +0100 |
commit | b992ca41965edf663f99bae19a95d59f2fd1ed97 (patch) | |
tree | 5a2014c5f8a5db44012bd81f5e6792170d7a55b1 /src/ft_exit.c | |
parent | I need a macOS (diff) | |
download | 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.gz 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.bz2 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.xz 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.tar.zst 42-cub3d-b992ca41965edf663f99bae19a95d59f2fd1ed97.zip |
okok
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); |