Free
This commit is contained in:
@@ -1,29 +1,29 @@
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* ::: :::::::: */
|
/* ::: :::::::: */
|
||||||
/* frees.c :+: :+: :+: */
|
/* frees.c :+: :+: :+: */
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/11/28 20:03:22 by aortigos #+# #+# */
|
/* Created: 2025/11/28 20:03:22 by aortigos #+# #+# */
|
||||||
/* Updated: 2025/11/28 20:09:04 by aortigos ### ########.fr */
|
/* Updated: 2025/11/28 20:09:04 by aortigos ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "../../includes/cub3d.h"
|
#include "../../includes/cub3d.h"
|
||||||
|
|
||||||
void freetl(char *ture, char *line, int fd)
|
void freetl(char *ture, char *line, int fd)
|
||||||
{
|
{
|
||||||
if (ture)
|
if (ture)
|
||||||
ft_memfree(ture);
|
ft_memfree(ture);
|
||||||
if (line)
|
if (line)
|
||||||
ft_memfree(line);
|
ft_memfree(line);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_map(t_data *data)
|
void free_map(t_data *data)
|
||||||
{
|
{
|
||||||
free2d(data->sq_map);
|
free2d(data->sq_map);
|
||||||
free2d(data->map2d);
|
free2d(data->map2d);
|
||||||
free2d(data->ture2d);
|
free2d(data->ture2d);
|
||||||
@@ -31,10 +31,10 @@ void free_map(t_data *data)
|
|||||||
free2d(data->ff);
|
free2d(data->ff);
|
||||||
if (data->cc)
|
if (data->cc)
|
||||||
free2d(data->cc);
|
free2d(data->cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_m(t_mlx *mlx)
|
void free_m(t_mlx *mlx)
|
||||||
{
|
{
|
||||||
if (mlx->dt->sq_map)
|
if (mlx->dt->sq_map)
|
||||||
free2d(mlx->dt->sq_map);
|
free2d(mlx->dt->sq_map);
|
||||||
if(mlx->dt->map2d)
|
if(mlx->dt->map2d)
|
||||||
@@ -45,10 +45,10 @@ void free_m(t_mlx *mlx)
|
|||||||
free2d(mlx->dt->ff);
|
free2d(mlx->dt->ff);
|
||||||
if (mlx->dt->cc)
|
if (mlx->dt->cc)
|
||||||
free2d(mlx->dt->cc);
|
free2d(mlx->dt->cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void freelist(t_turelist **txture)
|
void freelist(t_turelist **txture)
|
||||||
{
|
{
|
||||||
t_turelist *tmp;
|
t_turelist *tmp;
|
||||||
|
|
||||||
tmp = *txture;
|
tmp = *txture;
|
||||||
@@ -61,4 +61,4 @@ void freelist(t_turelist **txture)
|
|||||||
tmp = *txture;
|
tmp = *txture;
|
||||||
}
|
}
|
||||||
ft_memfree(*txture);
|
ft_memfree(*txture);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user