aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-16 19:41:26 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-16 19:41:26 +0100
commita8c9c04ec24a71f076891bdc1c26860db7c5c9c3 (patch)
treea5dc6905f6987c4d5fcd27276f7fc338f2af8f0b /src/ft_warp_level.c
parentCleaner memdels (diff)
parentMerge branch 'master' into back-to-pthread (diff)
download42-cub3d-a8c9c04ec24a71f076891bdc1c26860db7c5c9c3.tar.gz
42-cub3d-a8c9c04ec24a71f076891bdc1c26860db7c5c9c3.tar.bz2
42-cub3d-a8c9c04ec24a71f076891bdc1c26860db7c5c9c3.tar.xz
42-cub3d-a8c9c04ec24a71f076891bdc1c26860db7c5c9c3.tar.zst
42-cub3d-a8c9c04ec24a71f076891bdc1c26860db7c5c9c3.zip
Merge branch 'back-to-pthread'
Diffstat (limited to 'src/ft_warp_level.c')
-rw-r--r--src/ft_warp_level.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index bc903f0..fadbb2a 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -39,7 +39,6 @@ static void
ft_memdel((void*)&ml->mapl);
ft_free_sprites(ml->sprite_path);
ft_free_words(ml->map);
- ft_free_words(ml->mcmd_words);
}
static void
@@ -74,15 +73,15 @@ static void
{
if (isoldmus && !cl->mlist.ismusic)
{
- kill(cl->mpid, SIGTERM);
- wait(&cl->mpid);
+ pthread_cancel(cl->mtid);
+ pthread_join(cl->mtid, NULL);
cl->isoldmus = 0;
}
else if (isoldmus && cl->mlist.ismusic
&& ft_strncmp(tmp_mup, cl->mlist.music_path, ft_strlen(tmp_mup) + 1))
{
- kill(cl->mpid, SIGTERM);
- wait(&cl->mpid);
+ pthread_cancel(cl->mtid);
+ pthread_join(cl->mtid, NULL);
ft_enable_music(cl);
}
else if (isoldmus && cl->mlist.ismusic