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

Commit

Permalink
fix memory leak in blocked client
Browse files Browse the repository at this point in the history
  • Loading branch information
siscia committed Aug 14, 2019
1 parent 47448d0 commit 26d22c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redisql_lib/src/redis_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,22 @@ impl Context {
}
}
pub fn no_client() -> Self {
debug!("New thread safe context");
let ctx = unsafe {
ffi::RedisModule_GetThreadSafeContext.unwrap()(
std::ptr::null_mut(),
)
};
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(),
Expand Down

0 comments on commit 26d22c2

Please sign in to comment.