diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-02 16:09:57 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-02 16:09:57 +0100 |
commit | 48ccff3d712a2b30de8b94a5688afae7ee91a1c6 (patch) | |
tree | b21d77ba9be46b0ad4f5341487359cd2befa6e58 /src | |
parent | Music is bav but can't kill (diff) | |
download | 42-cub3d-48ccff3d712a2b30de8b94a5688afae7ee91a1c6.tar.gz 42-cub3d-48ccff3d712a2b30de8b94a5688afae7ee91a1c6.tar.bz2 42-cub3d-48ccff3d712a2b30de8b94a5688afae7ee91a1c6.tar.xz 42-cub3d-48ccff3d712a2b30de8b94a5688afae7ee91a1c6.tar.zst 42-cub3d-48ccff3d712a2b30de8b94a5688afae7ee91a1c6.zip |
YES
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_exit.c | 3 | ||||
-rw-r--r-- | src/ft_music.c | 1 | ||||
-rw-r--r-- | src/ft_treat_args.c | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index 493e00f..d4fb4f9 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -16,6 +16,7 @@ #include <stddef.h> #include <stdlib.h> #include <stdint.h> +#include <pthread.h> static void ft_free_lists(t_cub *clist) @@ -63,6 +64,8 @@ int } ft_free_lists(clist); ft_printf("Exiting program\n"); + pthread_cancel(clist->tid); + pthread_exit(NULL); exit(exit_code); return (0); } diff --git a/src/ft_music.c b/src/ft_music.c index cc8d1ca..a4d588a 100644 --- a/src/ft_music.c +++ b/src/ft_music.c @@ -37,7 +37,6 @@ void ft_printf("\n\n========= QWEQWE =========\n%s\n", cmd); system(cmd); ft_memdel((void**)&cmd); - pthread_exit(NULL); return (NULL); } diff --git a/src/ft_treat_args.c b/src/ft_treat_args.c index dab29ac..25c56d1 100644 --- a/src/ft_treat_args.c +++ b/src/ft_treat_args.c @@ -40,6 +40,7 @@ uint8_t if (clist->mlist->ismusic) { pthread_create(&clist->tid, NULL, ft_music_thread, clist); + /* ft_music_thread(clist); */ } ft_hooks_and_loops(clist->wlist, clist); } |