Skip to content

Commit

Permalink
call PyObject_GC_UnTrack() in tp_dealloc()
Browse files Browse the repository at this point in the history
see the following sites for details:

* https://bugs.python.org/issue31095
* python/cpython#2974

Fixes #35.
  • Loading branch information
KIMURA Chikahiro authored and jamadden committed Sep 11, 2017
1 parent a19b95f commit a11c5e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ Changes
4.1.2 (unreleased)
------------------

- Fix the extremely rare potential for a crash when the C extensions
are in use. See `issue 35 <https://github.com/zopefoundation/zope.security/issues/35>`_.

- Fix `issue 7
<https://github.com/zopefoundation/zope.security/issues/7`_: The
pure-Python proxy didn't propagate ``TypeError`` from ``__repr__``
Expand Down
1 change: 1 addition & 0 deletions src/zope/security/_proxy.c
Expand Up @@ -343,6 +343,7 @@ proxy_clear(SecurityProxy *self)
static void
proxy_dealloc(SecurityProxy *self)
{
PyObject_GC_UnTrack((PyObject*)self);
proxy_clear(self);
SecurityProxyType.tp_base->tp_dealloc((PyObject*)self);
}
Expand Down
1 change: 1 addition & 0 deletions src/zope/security/_zope_security_checker.c
Expand Up @@ -368,6 +368,7 @@ Checker_clear(Checker *self)
static void
Checker_dealloc(Checker *self)
{
PyObject_GC_UnTrack((PyObject*)self);
Checker_clear(self);
Py_TYPE(self)->tp_free((PyObject*)self);
}
Expand Down

0 comments on commit a11c5e2

Please sign in to comment.