Skip to content

Commit

Permalink
blocks: make sure we drop
Browse files Browse the repository at this point in the history
sometimes we can have owned blocks returned from ndb.get_blocks_by_key
  • Loading branch information
jb55 committed Dec 31, 2023
1 parent 8e2b52a commit 71d7ce1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 71d7ce1

Please sign in to comment.