Free the context after the user function was called. */
| 691 | |
| 692 | /* Free the context after the user function was called. */ |
| 693 | void moduleFreeContext(RedisModuleCtx *ctx, bool propogate) { |
| 694 | if (propogate) |
| 695 | moduleHandlePropagationAfterCommandCallback(ctx); |
| 696 | autoMemoryCollect(ctx); |
| 697 | poolAllocRelease(ctx); |
| 698 | if (ctx->postponed_arrays) { |
| 699 | zfree(ctx->postponed_arrays); |
| 700 | ctx->postponed_arrays_count = 0; |
| 701 | serverLog(LL_WARNING, |
| 702 | "API misuse detected in module %s: " |
| 703 | "RedisModule_ReplyWithArray(REDISMODULE_POSTPONED_ARRAY_LEN) " |
| 704 | "not matched by the same number of RedisModule_SetReplyArrayLen() " |
| 705 | "calls.", |
| 706 | ctx->module->name); |
| 707 | } |
| 708 | if (ctx->flags & REDISMODULE_CTX_THREAD_SAFE) freeClient(ctx->client); |
| 709 | } |
| 710 | |
| 711 | /* This Redis command binds the normal Redis command invocation with commands |
| 712 | * exported by modules. */ |
no test coverage detected