aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-07 13:58:21 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-07 13:58:21 +0200
commit9ec1dcddc92571ba7b65710f49ffc0d018c6db71 (patch)
treec4d3358e45b2d621a5e1e942291e41d17af9509f /src/ft_exit.c
parentBetter sound handling, few changes (diff)
download42-cub3d-9ec1dcddc92571ba7b65710f49ffc0d018c6db71.tar.gz
42-cub3d-9ec1dcddc92571ba7b65710f49ffc0d018c6db71.tar.bz2
42-cub3d-9ec1dcddc92571ba7b65710f49ffc0d018c6db71.tar.xz
42-cub3d-9ec1dcddc92571ba7b65710f49ffc0d018c6db71.tar.zst
42-cub3d-9ec1dcddc92571ba7b65710f49ffc0d018c6db71.zip
Freed big leaks
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r--src/ft_exit.c19
1 files changed, 15 insertions, 4 deletions
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 <stdlib.h>
#include <stdint.h>
#include <pthread.h>
+#include <signal.h>
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);
}
}