From 6cf55d78b06cfeaa17fbc1bf5c17a6b5ad655ec7 Mon Sep 17 00:00:00 2001 From: mpl Date: Thu, 12 Sep 2013 15:25:31 +0200 Subject: [PATCH] index: GetDirMembers, forgot to close iterator Could fix too many open files problem with sqlite reported by ajft Change-Id: Icde85b11dcd96a336d1bba1e15a7665a1b4a874a --- pkg/index/index.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/index/index.go b/pkg/index/index.go index a085f3007..775e67620 100644 --- a/pkg/index/index.go +++ b/pkg/index/index.go @@ -678,11 +678,12 @@ func (x *Index) EdgesTo(ref blob.Ref, opts *search.EdgesToOpts) (edges []*search } // GetDirMembers sends on dest the children of the static directory dir. -func (x *Index) GetDirMembers(dir blob.Ref, dest chan<- blob.Ref, limit int) error { +func (x *Index) GetDirMembers(dir blob.Ref, dest chan<- blob.Ref, limit int) (err error) { defer close(dest) sent := 0 it := x.queryPrefix(keyStaticDirChild, dir.String()) + defer closeIterator(it, &err) for it.Next() { keyPart := strings.Split(it.Key(), "|") if len(keyPart) != 3 {