-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfree_graph.c
More file actions
29 lines (26 loc) · 1.17 KB
/
free_graph.c
File metadata and controls
29 lines (26 loc) · 1.17 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free_graph.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mihykim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/13 11:30:25 by mihykim #+# #+# */
/* Updated: 2020/07/04 01:32:23 by mihykim ### ########.fr */
/* */
/* ************************************************************************** */
#include "graph.h"
void free_graph(t_graph *graph, void (*free_data)(void *))
{
unsigned int i;
if (graph == NULL || free_data == NULL)
return ;
for (i = 0; i < graph->size; i++)
{
free_data(graph->data[i]);
free(graph->matrix[i]);
}
free(graph->data);
free(graph->matrix);
free(graph);
}