// Close closes the iterator.  It closes all subiterators it can, but
// returns the first error it encounters.
351631
func (it *LinksTo) Close() error {
	err := it.nextIt.Close()

	_err := it.primaryIt.Close()
	if _err != nil && err == nil {
		err = _err
	}

	return err
}
588521
func (m *Main) Close() error {
	logger := m.Logger.New("fn", "Close")

	if m.ln != nil {
		if err := m.ln.Close(); err != nil {
			logger.Error("error closing listener", "err", err)
		}
	}

	return nil
}
666338
func (t *File) Close() error {
	t.closed = true
	return t.file.Close()
}
1197953
func (p *Pool) Close() error {
	defer scopedLock(&p.mutx)()

	var err error
	for _, pool := range p.pools {
		if e := pool.Close(); e != nil {
			err = e
		}
	}
	return err
}
31215
func (lli *llIterator) Close() error {
	var err0 error
	if lli.kvIterator != nil {
		err0 = lli.kvIterator.Close()
		lli.kvIterator = nil
	}

	var err1 error
	if lli.kvReader != nil {
		err1 = lli.kvReader.Close()
		lli.kvReader = nil
	}

	lli.llSnapshot.decRef()
	lli.llSnapshot = nil

	if err0 != nil {
		return err0
	}

	if err1 != nil {
		return err1
	}

	return nil
}
908179
func (i *blockIter) Close() error {
	i.key = nil
	i.val = nil
	i.eoi = true
	return i.err
}
1010788
func (stmt *Stmt) Close() error {
	var firstErr error

	if stmt.name != "" {
		firstErr = stmt.closeStmt()
	}

	err := stmt.db.Close()
	if err != nil && firstErr == nil {
		firstErr = err
	}

	return firstErr
}
675477
func (w *tWriter) close() {
	if w.w != nil {
		w.w.Close()
		w.w = nil
	}
}
809553
func (e *SortExec) Close() error {
	e.memTracker.Detach()
	e.memTracker = nil
	return e.children[0].Close()
}
91895
func (c MultiCollector) Close() error {
	return c.aggregateErrors(func(coll Collector) error { return coll.Close() })
}
805796
func (e *HashAggExec) Close() error {
	if e.isUnparallelExec {
		e.childResult = nil
		e.groupSet = nil
		e.partialResultMap = nil
		return e.baseExecutor.Close()
	}
	// `Close` may be called after `Open` without calling `Next` in test.
	if !e.prepared {
		close(e.inputCh)
		for _, ch := range e.partialOutputChs {
			close(ch)
		}
		close(e.finalOutputCh)
	}
	close(e.finishCh)
	for _, ch := range e.partialOutputChs {
		for range ch {
		}
	}
	for range e.finalOutputCh {
	}
	return e.baseExecutor.Close()
}
1091096
func (h *Handler) Close() error {
	h.done <- struct{}{}
	close(h.done)
	close(h.entries)
	return nil
}
1029046
func (s *Sentinel) Close() {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	s.close()
}
794506
func (pi *procIterator) Close() error {
	pi.Next()
	pi.procs = nil
	pi.Proc = nil
	return pi.err
}
222730
func (d *DotGit) Close() error {
	var firstError error
	if d.files != nil {
		for _, f := range d.files {
			err := f.Close()
			if err != nil && firstError == nil {
				firstError = err
				continue
			}
		}

		d.files = nil
	}

	if firstError != nil {
		return firstError
	}

	return nil
}
1155909
func (e *LimitExec) Close() error {
	e.childResult = nil
	return e.baseExecutor.Close()
}
285091
func (x *Index) Close() error {
	if cl, ok := x.s.(io.Closer); ok {
		return cl.Close()
	}
	return nil
}