| 230 | } |
| 231 | |
| 232 | static void IndexScanFree(OpBase *opBase) { |
| 233 | IndexScan *op = (IndexScan *)opBase; |
| 234 | /* As long as this Index iterator is alive the index is |
| 235 | * read locked, if this index scan operation is part of |
| 236 | * a query which will modified this index we'll be stuck in |
| 237 | * a dead lock, as we're unable to acquire index write lock. */ |
| 238 | if(op->iter != NULL) { |
| 239 | RediSearch_ResultsIteratorFree(op->iter); |
| 240 | op->iter = NULL; |
| 241 | } |
| 242 | |
| 243 | if(op->child_record != NULL) { |
| 244 | OpBase_DeleteRecord(op->child_record); |
| 245 | op->child_record = NULL; |
| 246 | } |
| 247 | |
| 248 | if(op->filter != NULL) { |
| 249 | FilterTree_Free(op->filter); |
| 250 | op->filter = NULL; |
| 251 | } |
| 252 | |
| 253 | if(op->unresolved_filters != NULL) { |
| 254 | FilterTree_Free(op->unresolved_filters); |
| 255 | op->unresolved_filters = NULL; |
| 256 | } |
| 257 | |
| 258 | if(op->n != NULL) { |
| 259 | NodeScanCtx_Free(op->n); |
| 260 | op->n = NULL; |
| 261 | } |
| 262 | } |
| 263 |
nothing calls this directly
no test coverage detected