From 007f030c3354f08edb778ed677c5c1122c0389ee Mon Sep 17 00:00:00 2001 From: rz694jd Date: Sun, 1 Dec 2019 12:34:36 +0100 Subject: [PATCH] Prva verzia --- a_station.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/a_station.c b/a_station.c index 661a4d7..931980f 100644 --- a/a_station.c +++ b/a_station.c @@ -10,6 +10,16 @@ struct station* create_station(){ } void destroy_station(struct station* station){ + for (int i = 0 ; i< station->capacity; i++){ + struct car* start = station->tracks[i]; + struct car* this = start; + while(this != NULL){ + next = this->next; + free(this); + this=next; + } + free(station->tracks[i]); + } } int select_track(struct station* station, const char* target){