free the allocations within the QueryCtx and reset it for the next query
| 451 | |
| 452 | // free the allocations within the QueryCtx and reset it for the next query |
| 453 | void QueryCtx_Free(void) { |
| 454 | QueryCtx *ctx = _QueryCtx_GetCtx(); |
| 455 | ASSERT(ctx != NULL); |
| 456 | |
| 457 | UndoLog_Free(&ctx->undo_log); |
| 458 | EffectsBuffer_Free(ctx->effects_buffer); |
| 459 | |
| 460 | if(ctx->query_data.params != NULL) { |
| 461 | raxFreeWithCallback(ctx->query_data.params, _ParameterFreeCallback); |
| 462 | ctx->query_data.params = NULL; |
| 463 | } |
| 464 | |
| 465 | rm_free(ctx); |
| 466 | |
| 467 | // NULL-set the context for reuse the next time this thread receives a query |
| 468 | QueryCtx_RemoveFromTLS(); |
| 469 | } |
| 470 |