diff --git a/src/module.cpp b/src/module.cpp index b2c19c735..1d00d2b1d 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3939,7 +3939,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); }