diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-06 19:03:24 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-06 19:03:51 +0100 |
commit | a35b258841cde7884f5bb71d5ae0951d5e3f27b7 (patch) | |
tree | b7d1c6801ba924e129b3d008091a3f1b2e0adc95 /src/ft_treat_args.c | |
parent | Name is Cub3D anyway (diff) | |
download | 42-cub3d-a35b258841cde7884f5bb71d5ae0951d5e3f27b7.tar.gz 42-cub3d-a35b258841cde7884f5bb71d5ae0951d5e3f27b7.tar.bz2 42-cub3d-a35b258841cde7884f5bb71d5ae0951d5e3f27b7.tar.xz 42-cub3d-a35b258841cde7884f5bb71d5ae0951d5e3f27b7.tar.zst 42-cub3d-a35b258841cde7884f5bb71d5ae0951d5e3f27b7.zip |
fork(3) going well, freed a leak
Diffstat (limited to 'src/ft_treat_args.c')
-rw-r--r-- | src/ft_treat_args.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ft_treat_args.c b/src/ft_treat_args.c index b588b46..accf3aa 100644 --- a/src/ft_treat_args.c +++ b/src/ft_treat_args.c @@ -37,8 +37,13 @@ uint8_t return (ft_exit(FT_RET_FAILED_MLX, clist)); ft_draw_scene(clist); if (clist->mlist.ismusic) - ft_music_fork(cl); + { /* create music fork() here */ + clist->isoldmus = 1; + clist->mpid = fork(); + if (clist->mpid == 0) + ft_music_fork(clist->mlist.music_cmd); + } ft_hooks_and_loops(&clist->wlist, clist); } else if (argc == 3 && !ft_strncmp("--save", argv[2], 7)) |