// Close MUST be called after inserting all values.
344425
func (b *Builder) Close() error {
	err := b.compileFrom(0)
	if err != nil {
		return err
	}
	root := b.unfinished.popRoot()
	rootAddr, err := b.compile(root)
	if err != nil {
		return err
	}
	return b.encoder.finish(b.len, rootAddr)
}
438619
func (r *Reference) Close() {
	if !r.setClosed() {
		// Already closed
		return
	}

	logger.Debug("Closing reference")

	r.notifyClosing()
	r.wg.Wait()
	r.finalize()
}
785717
func (ics *IterateCloserStruct) Close() error {
	if ics.CloserF != nil {
		return ics.CloserF()
	}
	return nil
}
148264
func (stmt *OCI8Stmt) Close() error {
	if stmt.closed {
		return nil
	}
	stmt.closed = true

	C.OCIHandleFree(unsafe.Pointer(stmt.stmt), C.OCI_HTYPE_STMT)

	stmt.stmt = nil
	stmt.pbind = nil

	return nil
}
558920
func (transactionDB *TransactionDB) Close() {
	C.rocksdb_transactiondb_close(transactionDB.c)
	transactionDB.c = nil
}
122369
func (writer *MultiWriter) Close() {
	writer.lock.Lock()
	defer writer.lock.Unlock()

	for _, fileWriter := range writer.writers {
		fileWriter.Close()
	}
	writer.closed = true
}
1091096
func (h *Handler) Close() error {
	h.done <- struct{}{}
	close(h.done)
	close(h.entries)
	return nil
}
1339419
func (col *Col) close() error {
	errs := make([]error, 0, 0)
	for i := 0; i < col.db.numParts; i++ {
		col.parts[i].DataLock.Lock()
		if err := col.parts[i].Close(); err != nil {
			errs = append(errs, err)
		}
		for _, ht := range col.hts[i] {
			if err := ht.Close(); err != nil {
				errs = append(errs, err)
			}
		}
		col.parts[i].DataLock.Unlock()
	}
	if len(errs) == 0 {
		return nil
	}
	return fmt.Errorf("%v", errs)
}
1319690
func (q *Query) Close() error {
	if q.stmt == nil {
		return nil
	}

	err := q.stmt.Close()
	q.stmt = nil
	return err
}
552541
func (c *Client) Close() error {
	c.once.Do(func() { close(c.done) })
	c.Flush()
	return nil
}
1140641
func (ss *SQLSubStore) Close() error {
	ss.Lock()
	if ss.closed {
		ss.Unlock()
		return nil
	}
	// Flush before switching the state to closed.
	err := ss.flush()
	ss.closed = true
	ss.Unlock()
	return err
}
564874
func (e *UnionExec) Close() error {
	close(e.finished)
	e.childrenResults = nil
	if e.resultPool != nil {
		for range e.resultPool {
		}
	}
	e.resourcePools = nil
	return e.baseExecutor.Close()
}
176589
func (rm *ResultMerger) Close(ctx context.Context) {
	for _, i := range rm.allInputs {
		i.Close(ctx)
	}
}
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
}
495921
func (dbGorp *DbGorp) Close() (err error) {
	if dbGorp.Map.Db != nil {
		err = dbGorp.Map.Db.Close()
	}
	return
}
939214
func (w *Wallet) Close() error {
	if w.WalletDatabaseOverlay == nil {
		return nil
	}
	return w.DBO.Close()
}
373781
func (c *Conn) Close() error {
	if c != nil {
		return c.sqlite.Close()
	}
	return nil
}