From a6a70a52cfc00cc7efdc69c12567ed9339d1b90d Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 7 Mar 2024 09:48:14 +0700 Subject: [PATCH] save --- mdbx/txn.go | 1 + mdbx/txn_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/mdbx/txn.go b/mdbx/txn.go index 2e04e72..d5b666f 100644 --- a/mdbx/txn.go +++ b/mdbx/txn.go @@ -682,6 +682,7 @@ func (txn *Txn) ListDBI() (res []string, err error) { if err != nil { return nil, err } + defer c.Close() for k, _, err := c.Get(nil, nil, First); k != nil; k, _, err = c.Get(nil, nil, Next) { if err != nil { return nil, err diff --git a/mdbx/txn_test.go b/mdbx/txn_test.go index 46d3b43..0499314 100644 --- a/mdbx/txn_test.go +++ b/mdbx/txn_test.go @@ -627,6 +627,7 @@ func TestTxn_Flags(t *testing.T) { if err != nil { return err } + defer cur.Close() k, v, err := cur.Get(nil, nil, Next) if err != nil { return err