| | 175 | } |
| | 176 | |
| | 177 | void gb_destroy_indices(GBCONTAINER *gbc) { |
| | 178 | gb_index_files_struct *ifs = GBCONTAINER_IFS(gbc); |
| | 179 | |
| | 180 | while (ifs) { |
| | 181 | GB_REL_IFES *if_entries = GB_INDEX_FILES_ENTRIES(ifs); |
| | 182 | |
| | 183 | for (int index = 0; index<ifs->hash_table_size; index++) { |
| | 184 | gb_if_entries *ifes = GB_ENTRIES_ENTRY(if_entries, index); |
| | 185 | |
| | 186 | while (ifes) { |
| | 187 | gb_if_entries *ifes_next = GB_IF_ENTRIES_NEXT(ifes); |
| | 188 | |
| | 189 | gbm_free_mem((char*)ifes, sizeof(*ifes), GB_GBM_INDEX(gbc)); |
| | 190 | ifes = ifes_next; |
| | 191 | } |
| | 192 | } |
| | 193 | free(if_entries); |
| | 194 | |
| | 195 | gb_index_files_struct *ifs_next = GB_INDEX_FILES_NEXT(ifs); |
| | 196 | free(ifs); |
| | 197 | ifs = ifs_next; |
| | 198 | } |