nostrdb-rs

nostrdb in rust!
git clone git://jb55.com/nostrdb-rs
Log | Files | Refs | Submodules | README | LICENSE

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:
Msrc/block.rs | 6++++++
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,