WriteBatch::iterate construct a Box<WriteBatchCallback> then convert it into raw pointer and pass it into C code. However, it fail to reclaim the memory. To fix the issue, we need to convert the raw pointer back into Box<WriteBatchCallback> and let rust to auto drop it.
https://github.com/tikv/rust-rocksdb/blob/master/src/write_batch.rs#L118
WriteBatch::iterate
construct aBox<WriteBatchCallback>
then convert it into raw pointer and pass it into C code. However, it fail to reclaim the memory. To fix the issue, we need to convert the raw pointer back intoBox<WriteBatchCallback>
and let rust to auto drop it. https://github.com/tikv/rust-rocksdb/blob/master/src/write_batch.rs#L118