Update _rocksdb.pyx

This commit is contained in:
iFA 2020-08-31 11:24:28 +02:00 committed by GitHub
parent 4bc9039ccc
commit 3f4e75f119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1725,14 +1725,11 @@ cdef class DB(object):
def close(self, safe=True):
cdef ColumnFamilyOptions copts
# -- iFA88 --
cdef cpp_bool c_safe = safe
if self.db != NULL:
# -- iFA88 -- <<
if hasattr(self, "db"):
# We need stop backround compactions
with nogil:
db.CancelAllBackgroundWork(self.db, c_safe)
# -- iFA88 -- >>
# We have to make sure we delete the handles so rocksdb doesn't
# assert when we delete the db
del self.cf_handles[:]