From 2ce92e5a29d679bb16fd2d90134f0b26cc647b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Gejdo=C5=A1?= Date: Thu, 23 Apr 2026 12:12:55 +0000 Subject: [PATCH] destroy --- du6/a_station.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/du6/a_station.c b/du6/a_station.c index 8f659d6..fd2579b 100644 --- a/du6/a_station.c +++ b/du6/a_station.c @@ -10,6 +10,17 @@ struct station* create_station(){ } void destroy_station(struct station* station){ + + for (int i = 0; i < station -> track_count; i++){ + struct car* temp = station -> tracks[i]; + while (temp != NULL) { + struct car* temp2 = temp; + temp = temp -> next; + free (temp2); + } + } + free(station); + } int select_track(struct station* station, const char* target){