From 16092c007e8767b32c107d74d3ea3d238f5e65ec Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 18:10:14 +0100 Subject: Preparing forks --- src/ft_exit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/ft_exit.c') diff --git a/src/ft_exit.c b/src/ft_exit.c index ca5201c..c7b2275 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -16,8 +16,6 @@ #include #include #include -#include -#include static void ft_free_lists(t_cub *clist) @@ -67,8 +65,7 @@ int } if (clist->isoldmus && clist->wlist.inited) { - pthread_cancel(clist->tid); - pthread_join(clist->tid, NULL); + /* kill fork() here */ } ft_free_lists(clist); ft_printf("Exiting program\n"); -- cgit v1.2.3 From a35b258841cde7884f5bb71d5ae0951d5e3f27b7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 19:03:24 +0100 Subject: fork(3) going well, freed a leak --- src/ft_exit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ft_exit.c') diff --git a/src/ft_exit.c b/src/ft_exit.c index c7b2275..3ba1237 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -15,6 +15,7 @@ #include #include #include +#include #include static void @@ -65,7 +66,7 @@ int } if (clist->isoldmus && clist->wlist.inited) { - /* kill fork() here */ + kill(clist->mpid, SIGTERM); } ft_free_lists(clist); ft_printf("Exiting program\n"); -- cgit v1.2.3 From f3aab6429d673342f4819f8a3c2857e48610689a Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 19:12:10 +0100 Subject: it's going well --- src/ft_exit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ft_exit.c') diff --git a/src/ft_exit.c b/src/ft_exit.c index 3ba1237..973abca 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -16,6 +16,7 @@ #include #include #include +#include #include static void @@ -67,6 +68,7 @@ int if (clist->isoldmus && clist->wlist.inited) { kill(clist->mpid, SIGTERM); + wait(&clist->mpid); } ft_free_lists(clist); ft_printf("Exiting program\n"); -- cgit v1.2.3 From 6a89966eed6110d0e7a7ec53727c4473d18ad441 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 20:43:42 +0100 Subject: Fuck execve --- src/ft_exit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ft_exit.c') diff --git a/src/ft_exit.c b/src/ft_exit.c index 973abca..be4d46e 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -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); } -- cgit v1.2.3