// Close closes the database, rendering it unusable for I/O, by deallocating
// the underlying handle.
//
// Any attempts to use the DB after Close is called will panic.
179133
func (db *DB) Close() {
	if db.closed {
		return
	}

	db.closed = true
	C.leveldb_close(db.Ldb)
}
1017408
func (ddb debugDB) Close() {
	fmt.Printf("%v.Close()\n", ddb.label)
	ddb.db.Close()
}
49144
func (c *Cluster) Close() error {
	close(c.stopCh)

	var errors []error
	for _, db := range c.dbs {
		if err := db.Close(); err != nil {
			errors = append(errors, err)
		}
	}

	if len(errors) != 0 {
		return fmt.Errorf("%v", errors)
	}

	return nil
}
1243868
func (c *CycleDB) Close() error {
	if !c.db.IsReadOnly() {
		close(c.readMovements)
	}
	c.wg.Wait()
	return c.db.Close()
}
158034
func (mysqld *Mysqld) Close() {
	if mysqld.dbaPool != nil {
		mysqld.dbaPool.Close()
	}
	if mysqld.appPool != nil {
		mysqld.appPool.Close()
	}
}
1024114
func (it *Iterator) Close() {
	C.leveldb_iter_destroy(it.Iter)
	it.Iter = nil
}
537641
func (session *Session) Close() {
	for _, v := range session.stmtCache {
		v.Close()
	}

	if session.db != nil {
		// When Close be called, if session is a transaction and do not call
		// Commit or Rollback, then call Rollback.
		if session.Tx != nil && !session.IsCommitedOrRollbacked {
			session.Rollback()
		}
		session.Tx = nil
		session.stmtCache = nil
		session.db = nil

		session.Statement.Init()
		session.IsAutoCommit = true
		session.IsCommitedOrRollbacked = false
		session.IsAutoClose = false
		session.AutoResetStatement = true
		session.prepareStmt = false

		// processors
		session.afterInsertBeans = nil
		session.afterUpdateBeans = nil
		session.afterDeleteBeans = nil
		session.beforeClosures = nil
		session.afterClosures = nil
	}
}
801306
func (db *DB) Close() (err error) {
	close(db.close)
	db.updateGCWG.Wait()

	// wait for gc worker to
	// return before closing the shed
	select {
	case <-db.collectGarbageWorkerDone:
	case <-time.After(5 * time.Second):
		log.Error("localstore: collect garbage worker did not return after db close")
	}
	return db.shed.Close()
}
131281
func (db *DB) Close() error {
	close(db.stopc)
	db.compactCancel()
	<-db.donec

	db.mtx.Lock()
	defer db.mtx.Unlock()

	var g errgroup.Group

	// blocks also contains all head blocks.
	for _, pb := range db.blocks {
		g.Go(pb.Close)
	}

	var merr tsdb_errors.MultiError

	merr.Add(g.Wait())

	if db.lockf != nil {
		merr.Add(db.lockf.Release())
	}
	merr.Add(db.head.Close())
	return merr.Err()
}
179871
func (r *RootKeyStorage) Close() error {
	if r.encKey != nil {
		r.encKey.Zero()
	}
	return r.DB.Close()
}
1716
func (a *Aliases) Close() error {
	a.mtx.Lock()
	defer a.mtx.Unlock()

	return a.db.Close()
}
590811
func (iter *Iterator) Close() {
	C.rocksdb_iter_destroy(iter.c)
	iter.c = nil
}
431485
func (db *DB) Close() error {
	db.mu.Lock()
	defer db.mu.Unlock()
	if db.closed {
		return ErrDatabaseClosed
	}
	db.closed = true
	if db.persist {
		db.file.Sync() // do a sync but ignore the error
		if err := db.file.Close(); err != nil {
			return err
		}
	}
	// Let's release all references to nil. This will help both with debugging
	// late usage panics and it provides a hint to the garbage collector
	db.keys, db.exps, db.idxs, db.file = nil, nil, nil, nil
	return nil
}
1053451
func (i *Index) Close() error {
	i.mu.Lock()
	defer i.mu.Unlock()

	// Close the attribute store.
	i.columnAttrs.Close()

	// Close all fields.
	for _, f := range i.fields {
		if err := f.Close(); err != nil {
			return errors.Wrap(err, "closing field")
		}
	}
	i.fields = make(map[string]*Field)

	return nil
}
631580
func (db *CLevelDB) Close() {
	db.db.Close()
	db.ro.Close()
	db.wo.Close()
	db.woSync.Close()
}
164069
func (db *ProposalDB) Close() error {
	if db == nil || db.dbP == nil {
		return nil
	}

	return db.dbP.Close()
}
1012120
func (plugin *ExamplePlugin) Close() error {
	if plugin.db != nil {
		return plugin.db.Close()
	}
	return nil
}