road::~road() { for(int i = 0; i < rw; i++) { delete[] roaddata[i]; delete[] temp_roaddata[i]; } delete[] roaddata; delete[] temp_roaddata; free_queues(); }
void road::clear() { for (int i = 0; i < rw; i++) { for (int j = 0; j < rl; j++) { roaddata[i][j].clear(); temp_roaddata[i][j].clear(); } } free_queues(); }
/* * * free_server - free a server and possibly its queues also * * sinfo - the server_info list head * free_queues_too - flag to free the queues attached to server also * * returns nothing * */ void free_server(server_info *sinfo, int free_objs_too) { if (sinfo == NULL) return; if (free_objs_too) { free_queues(sinfo -> queues, 1); free_nodes(sinfo -> nodes); } free_token_list(sinfo -> tokens); free_server_info(sinfo); }