Skip to content

Commit

Permalink
Merge pull request #8 from Amulet-Team/fix-deadlock
Browse files Browse the repository at this point in the history
Fix deadlock
  • Loading branch information
gentlegiantJGC authored Dec 7, 2022
2 parents 51e48ff + b39720a commit 9fc37c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/leveldb/_leveldb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class LevelDBException(Exception):

class LevelDB:
def __init__(self, path: str, create_if_missing: bool = False): ...
def close(self, compact: bool = True): ...
def close(self, compact: bool = False): ...
def get(self, key: bytes) -> bytes: ...
def put(self, key: bytes, val: bytes): ...
def putBatch(self, data: Dict[bytes, bytes]): ...
Expand Down
2 changes: 1 addition & 1 deletion src/leveldb/_leveldb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ cdef class LevelDB:
cdef Iterator iterator
if self.db is not NULL:
if compact:
self.compact()
self.db.CompactRange(NULL, NULL)
for iterator in self.iterators:
iterator.destroy()
del self.db
Expand Down

0 comments on commit 9fc37c7

Please sign in to comment.