-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4_free.c
29 lines (26 loc) · 1.11 KB
/
4_free.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 4_free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anhigo-s <anhigo-s@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/24 15:53:16 by anhigo-s #+# #+# */
/* Updated: 2022/03/24 16:06:48 by anhigo-s ### ########.fr */
/* */
/* ************************************************************************** */
#include "philosophers.h"
void free_think(t_philo *data)
{
t_thinker *temp;
int index;
index = data->args.nbr_philo;
while (index > 0)
{
temp = data->list;
data->list = data->list->next;
free(temp);
index--;
}
return ;
}