Commit 16e70dd3 authored by KIMURA Chikahiro's avatar KIMURA Chikahiro Committed by Jason Madden

Fix possibility of rare crash during dealloc. Fixes #75

parent 9e6e9102
......@@ -2277,8 +2277,10 @@ BTree_init(PyObject *self, PyObject *args, PyObject *kwds)
static void
BTree_dealloc(BTree *self)
{
if (self->state != cPersistent_GHOST_STATE)
PyObject_GC_UnTrack((PyObject *)self);
if (self->state != cPersistent_GHOST_STATE) {
_BTree_clear(self);
}
cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self);
}
......
......@@ -1708,8 +1708,10 @@ Bucket_init(PyObject *self, PyObject *args, PyObject *kwds)
static void
bucket_dealloc(Bucket *self)
{
if (self->state != cPersistent_GHOST_STATE)
PyObject_GC_UnTrack((PyObject *)self);
if (self->state != cPersistent_GHOST_STATE) {
_bucket_clear(self);
}
cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self);
}
......
......@@ -9,6 +9,9 @@
BTrees is used but the ``persistent`` C extension is not available.
Previously this could result in an odd ``AttributeError``. See
https://github.com/zopefoundation/BTrees/pull/55
- Fix the possibility of a rare crash in the C extension when
deallocating items. See https://github.com/zopefoundation/BTrees/issues/75
4.4.1 (2017-01-24)
------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment