-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfree.c
More file actions
46 lines (41 loc) · 1.37 KB
/
free.c
File metadata and controls
46 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smetola <smetola@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/20 10:00:00 by smetola #+# #+# */
/* Updated: 2023/09/20 10:00:00 by smetola ### ########.fr */
/* */
/* ************************************************************************** */
#include "miniRT.h"
void free_split(char **split)
{
int i;
if (!split)
return ;
i = 0;
while (split[i])
{
free(split[i]);
i++;
}
free(split);
}
void free_scene(t_scene *scene)
{
if (scene->spheres)
free(scene->spheres);
if (scene->planes)
free(scene->planes);
if (scene->cylinders)
free(scene->cylinders);
}
int ft_error(char *message)
{
write(2, "Error\n", 6);
write(2, message, ft_strlen(message));
write(2, "\n", 1);
return (0);
}