aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r--src/ft_exit.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 40860e7..a19bff3 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -43,9 +43,6 @@ static void
int
ft_exit(uint8_t exit_code, t_cub *clist)
{
- uint8_t ismus;
- pthread_t ttid;
-
if (clist->walltexgood)
{
if (clist->tlist[0].img)
@@ -66,14 +63,12 @@ int
mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr);
clist->wlist->winptr = NULL;
}
- ismus = clist->mlist->ismusic;
- ttid = clist->tid;
- ft_free_lists(clist);
- if (ismus)
+ if (clist->mlist->ismusic)
{
- pthread_cancel(ttid);
- pthread_join(ttid, NULL);
+ pthread_cancel(clist->tid);
+ pthread_join(clist->tid, NULL);
}
+ ft_free_lists(clist);
ft_printf("Exiting program\n");
exit(exit_code);
return (0);