destroy
This commit is contained in:
parent
0f96d71888
commit
2ce92e5a29
@ -10,6 +10,17 @@ struct station* create_station(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void destroy_station(struct station* 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){
|
int select_track(struct station* station, const char* target){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user