-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathultimate_exit.c
More file actions
36 lines (32 loc) · 1.24 KB
/
ultimate_exit.c
File metadata and controls
36 lines (32 loc) · 1.24 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ultimate_exit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbartole <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/07/11 17:54:40 by ehugh-be #+# #+# */
/* Updated: 2019/09/29 13:10:27 by mbartole ### ########.fr */
/* */
/* ************************************************************************** */
#include "lem_in.h"
void free_node(void *node)
{
t_wnode *nd;
nd = (t_wnode*)node;
ft_lstdel(&nd->in.links, NULL);
ft_lstdel(&nd->out.links, NULL);
free(nd->name);
free(node);
}
void ultimate_exit(t_mngr *mngr, int exit_code)
{
if (mngr)
{
ft_avlfree_custom(mngr->all_rooms, free_node);
free(mngr);
}
if (exit_code != 0)
ft_printf("ERROR");
exit(exit_code);
}