tikv / rust-rocksdb

rust wrapper for rocksdb
Apache License 2.0
278 stars 155 forks source link

WriteBatch::iterate memory leak #654

Closed yiwu-arbug closed 3 years ago

yiwu-arbug commented 3 years ago

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

yuqi1129 commented 3 years ago

Hi, i would like to take this ticket if it has not been assigned

tisonkun commented 3 years ago

It is clearly no one be assigned. Thanks for taking over this issue @yuqi1129 . I'll assign the issue to you.