Commit ddb955d2 authored by Jason Madden's avatar Jason Madden Committed by GitHub

Merge pull request #76 from zopefoundation/issue75

Fix possibility of rare crash during dealloc. Fixes #75
parents 9e6e9102 16e70dd3
...@@ -2277,8 +2277,10 @@ BTree_init(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -2277,8 +2277,10 @@ BTree_init(PyObject *self, PyObject *args, PyObject *kwds)
static void static void
BTree_dealloc(BTree *self) BTree_dealloc(BTree *self)
{ {
if (self->state != cPersistent_GHOST_STATE) PyObject_GC_UnTrack((PyObject *)self);
if (self->state != cPersistent_GHOST_STATE) {
_BTree_clear(self); _BTree_clear(self);
}
cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self); cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self);
} }
......
...@@ -1708,8 +1708,10 @@ Bucket_init(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -1708,8 +1708,10 @@ Bucket_init(PyObject *self, PyObject *args, PyObject *kwds)
static void static void
bucket_dealloc(Bucket *self) bucket_dealloc(Bucket *self)
{ {
if (self->state != cPersistent_GHOST_STATE) PyObject_GC_UnTrack((PyObject *)self);
if (self->state != cPersistent_GHOST_STATE) {
_bucket_clear(self); _bucket_clear(self);
}
cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self); cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self);
} }
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
BTrees is used but the ``persistent`` C extension is not available. BTrees is used but the ``persistent`` C extension is not available.
Previously this could result in an odd ``AttributeError``. See Previously this could result in an odd ``AttributeError``. See
https://github.com/zopefoundation/BTrees/pull/55 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) 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