示例#1
0
文件: leveldb.go 项目: reusee/obox
func (self *Leveldb) Close() error {
	C.leveldb_close(self.cdb)
	C.leveldb_readoptions_destroy(self.read_options)
	C.leveldb_writeoptions_destroy(self.write_options)
	C.leveldb_cache_destroy(self.cache)
	return nil
}
示例#2
0
文件: db.go 项目: huanshi/ledisdb
func (db *DB) Close() error {
	if db.db != nil {
		C.leveldb_close(db.db)
		db.db = nil
	}

	db.opts.Close()

	if db.cache != nil {
		db.cache.Close()
	}

	if db.filter != nil {
		db.filter.Close()
	}

	db.readOpts.Close()
	db.writeOpts.Close()
	db.iteratorOpts.Close()

	return nil
}
示例#3
0
// 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.
func (db *DB) Close() {
	C.leveldb_close(db.Ldb)
}
// Close the database
func (db *LevelDB) Close() {
	C.leveldb_close(db.CLevelDB)
}
示例#5
0
func (ldb *Db) Close() {
	C.leveldb_close(ldb.ldb)
}