Skip to content

Commit

Permalink
Merge pull request stephan-hof#40 from fish2000/patch-2
Browse files Browse the repository at this point in the history
Allow `rocksdb.DB` instances to be manually closed (second revision PR)
  • Loading branch information
twmht authored Feb 2, 2019
2 parents ccd9f21 + 952e7bb commit ee1bc5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rocksdb/_rocksdb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee1bc5a

Please sign in to comment.