From b06260ec8a070991dab5d91f84520ea435d7f5c2 Mon Sep 17 00:00:00 2001 From: H3XploR Date: Tue, 25 Feb 2025 19:38:44 +0100 Subject: [PATCH] regarder les autres leaks si jamais et faire des test pousee --- config.c | 4 ++-- miniRT.h | 3 ++- parsing_color.c | 4 ++-- parsing_light.c | 2 +- parsing_utils.c | 4 ++-- parsing_vector.c | 4 ++-- tags | 1 + 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/config.c b/config.c index b929c59..e2b05fc 100644 --- a/config.c +++ b/config.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/14 01:41:17 by yantoine #+# #+# */ -/* Updated: 2025/02/25 19:05:30 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 19:36:04 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -86,7 +86,7 @@ t_scene load_config(const char *filename) if (!line) break ; scene = parsing_line(line, scene); - free(line); } + ft_free_array(scene.all_file); return (scene); } diff --git a/miniRT.h b/miniRT.h index a9eff99..6610b7e 100644 --- a/miniRT.h +++ b/miniRT.h @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/13 20:02:36 by yantoine #+# #+# */ -/* Updated: 2025/02/25 18:35:45 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 19:21:06 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -124,6 +124,7 @@ typedef struct s_scene t_ambient ambient; t_camera camera; t_ray ray; + int problem; int num_spheres; int num_planes; int num_cylinders; diff --git a/parsing_color.c b/parsing_color.c index 51d6d10..8eded0c 100644 --- a/parsing_color.c +++ b/parsing_color.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/14 20:05:49 by yantoine #+# #+# */ -/* Updated: 2025/02/17 21:25:34 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 19:38:13 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,7 +37,7 @@ t_vec3 parse_color(const char *token, t_scene scene) ft_free_array(token_color); ft_free_array(scene.token_if_exit); ft_putendl_fd("error", 2); - free(scene.line_if_exit); + ft_free_array(scene.all_file); close(scene.fd_if_exit); exit(1); } diff --git a/parsing_light.c b/parsing_light.c index 1584801..eae56e7 100644 --- a/parsing_light.c +++ b/parsing_light.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/15 19:39:08 by yantoine #+# #+# */ -/* Updated: 2025/02/25 02:46:28 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 19:21:36 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/parsing_utils.c b/parsing_utils.c index 71da9bb..779be4b 100644 --- a/parsing_utils.c +++ b/parsing_utils.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/14 20:23:21 by yantoine #+# #+# */ -/* Updated: 2025/02/25 17:42:45 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 19:37:18 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -23,7 +23,7 @@ char **get_tokens_secure(t_scene scene, const int numObject, { ft_free_array(tokens); ft_putendl_fd("error", 2); - free(scene.line_if_exit); + ft_free_array(scene.all_file); close(scene.fd_if_exit); exit(1); } diff --git a/parsing_vector.c b/parsing_vector.c index 898b0fa..48c3fc0 100644 --- a/parsing_vector.c +++ b/parsing_vector.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/15 19:16:01 by yantoine #+# #+# */ -/* Updated: 2025/02/17 21:35:12 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 19:37:48 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,7 +38,7 @@ t_vec3 parse_vector(const char *token, t_scene scene) ft_free_array(token_vector); ft_free_array(scene.token_if_exit); ft_putendl_fd("error", 2); - free(scene.line_if_exit); + ft_free_array(scene.all_file); close(scene.fd_if_exit); exit(1); } diff --git a/tags b/tags index cb26a8d..9b6d696 100644 --- a/tags +++ b/tags @@ -617,6 +617,7 @@ print_sphere print_next.c /^void print_sphere(t_sphere sphere)$/;" f typeref:typ print_vec3 print_next.c /^void print_vec3(t_vec3 vec)$/;" f typeref:typename:void printf_fd libft/printf_fd.c /^int printf_fd(int fd, const char *str, ...)$/;" f typeref:typename:int private_cmap minilibx-linux/mlx_int.h /^ int private_cmap;$/;" m struct:s_xvar typeref:typename:int +problem miniRT.h /^ int problem;$/;" m struct:s_scene typeref:typename:int proj miniRT.h /^ float proj;$/;" m struct:s_calc typeref:typename:float pshm_format minilibx-linux/mlx_int.h /^ int pshm_format;$/;" m struct:s_xvar typeref:typename:int putnbr_b libft/printf_fd.c /^static int putnbr_b(t_lu n, char *str, int numdig, t_info *info)$/;" f typeref:typename:int file: