From 9ec1dcddc92571ba7b65710f49ffc0d018c6db71 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 7 Apr 2020 13:58:21 +0200 Subject: Freed big leaks --- src/ft_exit.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/ft_exit.c') diff --git a/src/ft_exit.c b/src/ft_exit.c index 6d93f8e..4f2494b 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -17,6 +17,7 @@ #include #include #include +#include static void ft_del_last_remains(t_cub *clist) @@ -45,15 +46,25 @@ static void if (clist->isoldmus && clist->wlist.inited) { - pthread_cancel(clist->mtid); - pthread_join(clist->mtid, NULL); + if (FT_OS == 2) + { + pthread_cancel(clist->mtid); + pthread_join(clist->mtid, NULL); + } + else + system(FT_SND_TERM_CMD); } i = -1; while (++i < FT_TOTAL_SFX) { pthread_mutex_unlock(&clist->sfx[i].mutex); - pthread_cancel(clist->sfx[i].tid); - pthread_join(clist->sfx[i].tid, NULL); + if (FT_OS == 2) + { + pthread_cancel(clist->sfx[i].tid); + pthread_join(clist->sfx[i].tid, NULL); + } + else + system(FT_SND_TERM_CMD); } } -- cgit v1.2.3