frees sort
| 213 | |
| 214 | // frees sort |
| 215 | static void SortFree(OpBase *ctx) { |
| 216 | OpSort *op = (OpSort *)ctx; |
| 217 | |
| 218 | if(op->heap) { |
| 219 | uint recordCount = Heap_count(op->heap); |
| 220 | for(uint i = 0; i < recordCount; i++) { |
| 221 | Record r = (Record)Heap_poll(op->heap); |
| 222 | OpBase_DeleteRecord(r); |
| 223 | } |
| 224 | Heap_free(op->heap); |
| 225 | op->heap = NULL; |
| 226 | } |
| 227 | |
| 228 | if(op->buffer) { |
| 229 | uint recordCount = array_len(op->buffer); |
| 230 | for(uint i = op->record_idx; i < recordCount; i++) { |
| 231 | Record r = op->buffer[i]; |
| 232 | OpBase_DeleteRecord(r); |
| 233 | } |
| 234 | array_free(op->buffer); |
| 235 | op->buffer = NULL; |
| 236 | } |
| 237 | |
| 238 | if(op->record_offsets) { |
| 239 | array_free(op->record_offsets); |
| 240 | op->record_offsets = NULL; |
| 241 | } |
| 242 | |
| 243 | if(op->directions) { |
| 244 | array_free(op->directions); |
| 245 | op->directions = NULL; |
| 246 | } |
| 247 | |
| 248 | if(op->exps) { |
| 249 | uint exps_count = array_len(op->exps); |
| 250 | for(uint i = 0; i < exps_count; i++) AR_EXP_Free(op->exps[i]); |
| 251 | array_free(op->exps); |
| 252 | op->exps = NULL; |
| 253 | } |
| 254 | } |
nothing calls this directly
no test coverage detected