Skip to content
This repository was archived by the owner on Jul 11, 2021. It is now read-only.

Commit 26d22c2

Browse files
committed
fix memory leak in blocked client
1 parent 47448d0 commit 26d22c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

redisql_lib/src/redis_type.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,22 @@ impl Context {
2929
}
3030
}
3131
pub fn no_client() -> Self {
32+
debug!("New thread safe context");
3233
let ctx = unsafe {
3334
ffi::RedisModule_GetThreadSafeContext.unwrap()(
3435
std::ptr::null_mut(),
3536
)
3637
};
3738
Context {
3839
ctx,
39-
thread_safe: false,
40+
thread_safe: true,
4041
}
4142
}
4243
pub fn as_ptr(&self) -> *mut ffi::RedisModuleCtx {
4344
self.ctx
4445
}
4546
pub fn thread_safe(blocked_client: &BlockedClient) -> Context {
47+
debug!("New thread safe context");
4648
let ctx = unsafe {
4749
ffi::RedisModule_GetThreadSafeContext.unwrap()(
4850
blocked_client.as_ptr(),

0 commit comments

Comments
 (0)