diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-06 22:10:16 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-06 22:10:16 +0100 |
commit | 079a4b6e9389b05db2c672594cfb2f2b197e35dd (patch) | |
tree | f4a2bc882dd7667e2c9758e2be38e3484879e225 /src/ft_exit.c | |
parent | qwe (diff) | |
parent | okok (diff) | |
download | 42-cub3d-079a4b6e9389b05db2c672594cfb2f2b197e35dd.tar.gz 42-cub3d-079a4b6e9389b05db2c672594cfb2f2b197e35dd.tar.bz2 42-cub3d-079a4b6e9389b05db2c672594cfb2f2b197e35dd.tar.xz 42-cub3d-079a4b6e9389b05db2c672594cfb2f2b197e35dd.tar.zst 42-cub3d-079a4b6e9389b05db2c672594cfb2f2b197e35dd.zip |
Merge branch 'fork-music'
Diffstat (limited to '')
-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 ca5201c..be4d46e 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -15,9 +15,9 @@ #include <mlx.h> #include <stddef.h> #include <stdlib.h> -#include <stdint.h> #include <signal.h> -#include <pthread.h> +#include <sys/wait.h> +#include <stdint.h> static void ft_free_lists(t_cub *clist) @@ -34,6 +34,7 @@ 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); if (!clist->wlist.inited) ft_memdel((void**)&clist->wlist.winptr); } @@ -67,8 +68,8 @@ int } if (clist->isoldmus && clist->wlist.inited) { - pthread_cancel(clist->tid); - pthread_join(clist->tid, NULL); + kill(clist->mpid, SIGTERM); + wait(&clist->mpid); } ft_free_lists(clist); ft_printf("Exiting program\n"); |