Fix possible crash if snapshot and DB take part in cyclic gargabe collection
The cyclic garbage collector may choose this snappshot object to break the cycle. In that case tp_clear will remove the reference to self.db. So if __dealloc__ of the snapshot is called, self.db is not valid anymore
This commit is contained in:
parent
bb31b34613
commit
6ad545cea0
1 changed files with 1 additions and 0 deletions
|
@ -1309,6 +1309,7 @@ cdef class DB(object):
|
|||
def __get__(self):
|
||||
return self.opts
|
||||
|
||||
@cython.no_gc_clear
|
||||
@cython.internal
|
||||
cdef class Snapshot(object):
|
||||
cdef const snapshot.Snapshot* ptr
|
||||
|
|
Loading…
Add table
Reference in a new issue