-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathm_free_xd.c
More file actions
46 lines (41 loc) · 1.27 KB
/
m_free_xd.c
File metadata and controls
46 lines (41 loc) · 1.27 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* m_free_xd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nkawaguc <nkawaguc@student.42tokyo.jp> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/28 12:19:50 by nkawaguc #+# #+# */
/* Updated: 2024/10/28 12:19:50 by nkawaguc ### ########.fr */
/* */
/* ************************************************************************** */
#include "m_fdf.h"
void free_3d(char ***p)
{
int i;
int j;
i = -1;
while (p[++i] != NULL)
{
j = -1;
while (p[i][++j] != NULL)
free(p[i][j]);
free(p[i]);
}
free(p);
}
void free_map(t_map *map)
{
int i;
i = -1;
while (++i < map->height)
{
free(map->data[i]);
free(map->color[i]);
free(map->points[i]);
}
free(map->data);
free(map->color);
free(map->points);
free(map);
}