diff --git a/src/module.cpp b/src/module.cpp index 8d935c0cc..f071ae4e1 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3920,7 +3920,9 @@ RedisModuleCtx *RM_GetThreadSafeContext(RedisModuleBlockedClient *bc) { /* Release a thread safe context. */ void RM_FreeThreadSafeContext(RedisModuleCtx *ctx) { + moduleAcquireGIL(false /*fServerThread*/); moduleFreeContext(ctx); + moduleReleaseGIL(false /*fServerThread*/); zfree(ctx); }