From a11c5e20c2e25a5f7f32f1c11e4d4f47322ff3bb Mon Sep 17 00:00:00 2001 From: KIMURA Chikahiro Date: Mon, 7 Aug 2017 17:48:08 +0900 Subject: call PyObject_GC_UnTrack() in tp_dealloc() see the following sites for details: * https://bugs.python.org/issue31095 * https://github.com/python/cpython/pull/2974 Fixes #35. --- src/zope/security/_proxy.c | 1 + src/zope/security/_zope_security_checker.c | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/zope/security/_proxy.c b/src/zope/security/_proxy.c index 5108065..04321d7 100644 --- a/src/zope/security/_proxy.c +++ b/src/zope/security/_proxy.c @@ -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); } diff --git a/src/zope/security/_zope_security_checker.c b/src/zope/security/_zope_security_checker.c index e5a2528..82edbbf 100644 --- a/src/zope/security/_zope_security_checker.c +++ b/src/zope/security/_zope_security_checker.c @@ -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); } -- cgit v1.2.1