mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-02-16 00:23:56 +00:00
Close iterators (#1542)
* Add Close() function to all the iterators * Add defer iterator.Close() whenever we open an iterator * Add isClosed to all iterators and panic/return error if used after closing Co-authored-by: Svarog <feanorr@gmail.com>
This commit is contained in:
@@ -106,7 +106,8 @@ func (c *LevelDBCursor) Close() error {
|
||||
return errors.New("cannot close an already closed cursor")
|
||||
}
|
||||
c.isClosed = true
|
||||
|
||||
c.ldbIterator.Release()
|
||||
c.ldbIterator = nil
|
||||
c.bucket = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user