forestdb.lib: iterator needs to call free on docs.

db4
Doug Coleman 2014-11-07 02:23:19 -08:00
parent 2f2cd7b299
commit 24c6bbc2a8
1 changed files with 5 additions and 3 deletions

View File

@ -259,9 +259,11 @@ T{ doc
dup length fdb_iterator_seek fdb-check-error ;
: with-fdb-iterator ( start-key end-key fdb_iterator_opt_t iterator-init iterator-next quot: ( obj -- ) -- )
[ '[ _ _ _ _ execute ] call ] 2dip pick '[
[ _ handle>> _ execute [ [ @ ] when* ] keep ] loop
_ &dispose drop
[ execute ] 2dip
'[
_ &dispose handle>> [
_ execute [ _ with-doc t ] [ f ] if*
] curry loop
] with-destructors ; inline
: with-fdb-normal-iterator ( start-key end-key quot -- )