From 26d22c2b91860b4205919f9ca52f7b2b86c42edf Mon Sep 17 00:00:00 2001 From: Simone Mosciatti Date: Wed, 14 Aug 2019 19:03:34 +0200 Subject: [PATCH] fix memory leak in blocked client --- redisql_lib/src/redis_type.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redisql_lib/src/redis_type.rs b/redisql_lib/src/redis_type.rs index 2b6a985..a3120ed 100644 --- a/redisql_lib/src/redis_type.rs +++ b/redisql_lib/src/redis_type.rs @@ -29,6 +29,7 @@ impl Context { } } pub fn no_client() -> Self { + debug!("New thread safe context"); let ctx = unsafe { ffi::RedisModule_GetThreadSafeContext.unwrap()( std::ptr::null_mut(), @@ -36,13 +37,14 @@ impl Context { }; Context { ctx, - thread_safe: false, + thread_safe: true, } } pub fn as_ptr(&self) -> *mut ffi::RedisModuleCtx { self.ctx } pub fn thread_safe(blocked_client: &BlockedClient) -> Context { + debug!("New thread safe context"); let ctx = unsafe { ffi::RedisModule_GetThreadSafeContext.unwrap()( blocked_client.as_ptr(),