mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 14:41:02 +00:00
Fix rbf.Cursor.Close() panic
This commit is contained in:
parent
17e010cca2
commit
93f06e0f9d
1 changed files with 3 additions and 0 deletions
|
|
@ -1388,7 +1388,10 @@ func (c *Cursor) difference(key uint64, data *roaring.Container) (bool, error) {
|
|||
func (c *Cursor) Close() {
|
||||
if c == nil {
|
||||
panic("cannot Close nil Cursor")
|
||||
} else if c.tx == nil || c.tx.db == nil {
|
||||
return // already closed
|
||||
}
|
||||
|
||||
tx := c.tx
|
||||
c.tx = nil // allow tx to be garbage collected.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue