commit 71d7ce19d64e15f364d9908e5e34f0409395054c
parent 8e2b52a815ffc8ca67900cf9b44fe15c49a5a418
Author: William Casarin <jb55@jb55.com>
Date: Sat, 30 Dec 2023 21:22:42 -0800
blocks: make sure we drop
sometimes we can have owned blocks returned from ndb.get_blocks_by_key
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/block.rs b/src/block.rs
@@ -105,6 +105,12 @@ impl<'a> Blocks<'a> {
}
}
+impl<'a> Drop for Blocks<'a> {
+ fn drop(&mut self) {
+ unsafe { bindings::ndb_blocks_free(self.as_ptr()) };
+ }
+}
+
impl<'a> BlockIter<'a> {
pub(crate) fn new_transactional(
content: *const ::std::os::raw::c_char,