Skip to content

Commit a4b764e

Browse files
committed
Breaking into scope blocks to make sure all memory allocated before we
switch to Redis allocator will be out of scope
1 parent fff19f9 commit a4b764e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/macros.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ macro_rules! redis_module {
8888
return raw::Status::Err as c_int;
8989
}
9090
)*
91+
}
9192

93+
// Using another block to make sure all memory allocated before we
94+
// switch to Redis allocator will be out of scope
95+
unsafe {
9296
if true {
9397
redismodule::alloc::use_redis_alloc();
9498
} else {

0 commit comments

Comments
 (0)