aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tx.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/tx.go b/tx.go
index 6b52b2c..cb60149 100644
--- a/tx.go
+++ b/tx.go
@@ -236,7 +236,8 @@ func (tx *Tx) close() {
var freelistPendingN = tx.db.freelist.pending_count()
var freelistAlloc = tx.db.freelist.size()
- // Remove writer lock.
+ // Remove transaction ref & writer lock.
+ tx.db.rwtx = nil
tx.db.rwlock.Unlock()
// Merge statistics.
@@ -250,7 +251,12 @@ func (tx *Tx) close() {
} else {
tx.db.removeTx(tx)
}
+
+ // Clear all references.
tx.db = nil
+ tx.meta = nil
+ tx.root = Bucket{tx: tx}
+ tx.pages = nil
}
// Copy writes the entire database to a writer.