Esempio n. 1
0
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
}
Esempio n. 2
0
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
}
Esempio n. 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)
}
Esempio n. 5
0
func (ldb *Db) Close() {
	C.leveldb_close(ldb.ldb)
}