0
0

fix two missing Close calls holding iterators open

This commit is contained in:
Marty Schoch 2014-08-25 15:13:15 -04:00
parent 8bcf6adb60
commit 45a7a6dd8e
2 changed files with 2 additions and 0 deletions

View File

@ -553,6 +553,7 @@ func (udc *UpsideDownCouch) Document(id string) (*document.Document, error) {
storedRow := NewStoredRow(id, 0, []uint64{}, 'x', nil)
storedRowScanPrefix := storedRow.ScanPrefixForDoc()
it := udc.store.Iterator(storedRowScanPrefix)
defer it.Close()
key, val, valid := it.Current()
for valid {
if !bytes.HasPrefix(key, storedRowScanPrefix) {

View File

@ -305,6 +305,7 @@ func (i *indexImpl) Search(req *SearchRequest) (*SearchResult, error) {
if err != nil {
return nil, err
}
defer searcher.Close()
if req.Facets != nil {
facetsBuilder := search.NewFacetsBuilder(i.i)