Skip to content

Commit

Permalink
Merge pull request #1349 from blevesearch/close_err
Browse files Browse the repository at this point in the history
Initialise the root snapshot's DecRef errs with Close()
  • Loading branch information
sreekanth-cb committed Mar 17, 2020
2 parents 2f21902 + 1b6b979 commit f9a23fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index/scorch/scorch.go
Expand Up @@ -263,7 +263,10 @@ func (s *Scorch) Close() (err error) {
err = s.rootBolt.Close()
s.rootLock.Lock()
if s.root != nil {
_ = s.root.DecRef()
err2 := s.root.DecRef()
if err == nil {
err = err2
}
}
s.root = nil
s.rootLock.Unlock()
Expand Down

0 comments on commit f9a23fb

Please sign in to comment.