From f088575049dba6eb32b341b75e1e92106470bdba Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 21 Aug 2014 22:49:58 -0600 Subject: [PATCH] Fix split root dereference. This commit fixes a bug that occurs when a root node is split just after a re-mmap occurs. Previously, this would cause a panic because the new root node would still reference keys from the old mmap. --- bucket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bucket.go b/bucket.go index 2b0e340..2630800 100644 --- a/bucket.go +++ b/bucket.go @@ -645,7 +645,7 @@ func (b *Bucket) free() { // dereference removes all references to the old mmap. func (b *Bucket) dereference() { if b.rootNode != nil { - b.rootNode.dereference() + b.rootNode.root().dereference() } for _, child := range b.buckets {