aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-24 19:12:32 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-24 19:12:32 +0200
commit8725aebe8e8e8efd8781ec1b1637cb68f943b8bf (patch)
tree0d2eea782319d11ce30eadfce6cb301008889f63 /src
parentWorks but leaks (diff)
download42-cub3d-8725aebe8e8e8efd8781ec1b1637cb68f943b8bf.tar.gz
42-cub3d-8725aebe8e8e8efd8781ec1b1637cb68f943b8bf.tar.bz2
42-cub3d-8725aebe8e8e8efd8781ec1b1637cb68f943b8bf.tar.xz
42-cub3d-8725aebe8e8e8efd8781ec1b1637cb68f943b8bf.tar.zst
42-cub3d-8725aebe8e8e8efd8781ec1b1637cb68f943b8bf.zip
Fine
Diffstat (limited to 'src')
-rw-r--r--src/ft_exit.c5
-rw-r--r--src/ft_sfx_bb_death.c2
-rw-r--r--src/ft_sfx_bb_fire.c2
-rw-r--r--src/ft_sfx_bb_scream.c4
-rw-r--r--src/ft_sfx_death.c2
-rw-r--r--src/ft_sfx_footstep.c4
-rw-r--r--src/ft_sfx_heal.c2
-rw-r--r--src/ft_sfx_new_level.c2
-rw-r--r--src/ft_sfx_ooa.c2
-rw-r--r--src/ft_sfx_pain.c4
-rw-r--r--src/ft_sfx_trap.c2
11 files changed, 15 insertions, 16 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 8c85fdb..d9d9ef8 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -49,7 +49,7 @@ static void
if (FT_OS == 2)
{
pthread_cancel(clist->mtid);
- /* pthread_join(clist->mtid, NULL); */
+ pthread_join(clist->mtid, NULL);
}
else
system(FT_SND_TERM_CMD);
@@ -59,9 +59,8 @@ static void
{
if (FT_OS == 2)
{
+ pthread_mutex_destroy(&clist->sfx[i].mutex);
system(FT_SND_TERM_CMD);
- /* pthread_cancel(clist->sfx[i].tid); */
- pthread_join(clist->sfx[i].tid, NULL);
}
else
system(FT_SND_TERM_CMD);
diff --git a/src/ft_sfx_bb_death.c b/src/ft_sfx_bb_death.c
index 7466c57..23a96d8 100644
--- a/src/ft_sfx_bb_death.c
+++ b/src/ft_sfx_bb_death.c
@@ -29,7 +29,7 @@ void
{
pthread_mutex_lock(&sfx[13].mutex);
if (system(sfx[13].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_bb_fire.c b/src/ft_sfx_bb_fire.c
index ab64b44..df89544 100644
--- a/src/ft_sfx_bb_fire.c
+++ b/src/ft_sfx_bb_fire.c
@@ -29,7 +29,7 @@ void
{
pthread_mutex_lock(&sfx[15].mutex);
if (system(sfx[15].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_bb_scream.c b/src/ft_sfx_bb_scream.c
index f9c74f7..7c68c53 100644
--- a/src/ft_sfx_bb_scream.c
+++ b/src/ft_sfx_bb_scream.c
@@ -32,10 +32,10 @@ void
if (ref % 3)
{
if (system(sfx[14].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
else if (system(sfx[14].cmd_alt))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_death.c b/src/ft_sfx_death.c
index 9415c56..76a98cd 100644
--- a/src/ft_sfx_death.c
+++ b/src/ft_sfx_death.c
@@ -28,7 +28,7 @@ void
{
pthread_mutex_lock(&sfx[0].mutex);
if (system(sfx[0].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_footstep.c b/src/ft_sfx_footstep.c
index 5b8fe8a..628660b 100644
--- a/src/ft_sfx_footstep.c
+++ b/src/ft_sfx_footstep.c
@@ -32,10 +32,10 @@ void
if (ref % 2)
{
if (system(sfx[1].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
else if (system(sfx[1].cmd_alt))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_heal.c b/src/ft_sfx_heal.c
index b58196f..b95fc2c 100644
--- a/src/ft_sfx_heal.c
+++ b/src/ft_sfx_heal.c
@@ -28,7 +28,7 @@ void
{
pthread_mutex_lock(&sfx[5].mutex);
if (system(sfx[5].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_new_level.c b/src/ft_sfx_new_level.c
index f1f737e..e4f3bff 100644
--- a/src/ft_sfx_new_level.c
+++ b/src/ft_sfx_new_level.c
@@ -28,7 +28,7 @@ void
{
pthread_mutex_lock(&sfx[2].mutex);
if (system(sfx[2].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_ooa.c b/src/ft_sfx_ooa.c
index 48c2e5d..5950d2e 100644
--- a/src/ft_sfx_ooa.c
+++ b/src/ft_sfx_ooa.c
@@ -28,7 +28,7 @@ void
{
pthread_mutex_lock(&sfx[12].mutex);
if (system(sfx[12].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_pain.c b/src/ft_sfx_pain.c
index baf689b..d55c01c 100644
--- a/src/ft_sfx_pain.c
+++ b/src/ft_sfx_pain.c
@@ -32,10 +32,10 @@ void
if (ref % 3)
{
if (system(sfx[3].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
else if (system(sfx[3].cmd_alt))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}
diff --git a/src/ft_sfx_trap.c b/src/ft_sfx_trap.c
index 60cd7c6..5ae39f0 100644
--- a/src/ft_sfx_trap.c
+++ b/src/ft_sfx_trap.c
@@ -28,7 +28,7 @@ void
{
pthread_mutex_lock(&sfx[4].mutex);
if (system(sfx[4].cmd))
- pthread_cancel(pthread_self());
+ pthread_exit(NULL);
}
return (NULL);
}