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:
hofmockel 2014-01-23 08:10:51 +01:00
parent bb31b34613
commit 6ad545cea0

View file

@ -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