Skip to content

Commit

Permalink
forestdb.lib: iterator needs to call free on docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
erg committed Nov 7, 2014
1 parent 2f2cd7b commit 24c6bbc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions extra/forestdb/lib/lib.factor
Expand Up @@ -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 -- )
Expand Down

0 comments on commit 24c6bbc

Please sign in to comment.