Commit 4d2dcc93 authored by KIMURA Chikahiro's avatar KIMURA Chikahiro Committed by Jason Madden

Fix possibility of rare crash during dealloc. Fixes #66

parent 740e1d42
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
4.2.5 (unreleased) 4.2.5 (unreleased)
------------------ ------------------
- Nothing changed yet. - Fix the possibility of a rare crash in the C extension when
deallocating items. See https://github.com/zopefoundation/persistent/issues/66
4.2.4.2 (2017-04-23) 4.2.4.2 (2017-04-23)
......
...@@ -783,6 +783,7 @@ Per__getstate__(cPersistentObject *self) ...@@ -783,6 +783,7 @@ Per__getstate__(cPersistentObject *self)
static void static void
Per_dealloc(cPersistentObject *self) Per_dealloc(cPersistentObject *self)
{ {
PyObject_GC_UnTrack((PyObject *)self);
if (self->state >= 0) if (self->state >= 0)
{ {
/* If the cache has been cleared, then a non-ghost object /* If the cache has been cleared, then a non-ghost object
......
...@@ -891,6 +891,7 @@ cc_init(ccobject *self, PyObject *args, PyObject *kwds) ...@@ -891,6 +891,7 @@ cc_init(ccobject *self, PyObject *args, PyObject *kwds)
static void static void
cc_dealloc(ccobject *self) cc_dealloc(ccobject *self)
{ {
PyObject_GC_UnTrack((PyObject *)self);
Py_XDECREF(self->data); Py_XDECREF(self->data);
Py_XDECREF(self->jar); Py_XDECREF(self->jar);
PyObject_GC_Del(self); PyObject_GC_Del(self);
......
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