Merge pull request #40 from fish2000/patch-2

Allow `rocksdb.DB` instances to be manually closed (second revision PR)
This commit is contained in:
Ming-Hsuan-Tu 2019-02-02 12:45:08 +08:00 committed by GitHub
commit ee1bc5a0b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1671,6 +1671,9 @@ cdef class DB(object):
self.opts.in_use = True
def __dealloc__(self):
self.close()
def close(self):
cdef ColumnFamilyOptions copts
if not self.db == NULL:
# We have to make sure we delete the handles so rocksdb doesn't