summaryrefslogtreecommitdiffstats
path: root/Modules/_threadmodule.c
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-07-27 15:03:38 (GMT)
committerGitHub <noreply@github.com>2022-07-27 15:03:38 (GMT)
commitf40bc7fa49f8d137f9b38f7a14569e9a9bdbed07 (patch)
tree01f24798d6ac958feac40337a0a877ba60a66b5f /Modules/_threadmodule.c
parent2833f3798dc3647e850b303a4d0fa00609a0ae9b (diff)
downloadcpython-f40bc7fa49f8d137f9b38f7a14569e9a9bdbed07.zip
cpython-f40bc7fa49f8d137f9b38f7a14569e9a9bdbed07.tar.gz
cpython-f40bc7fa49f8d137f9b38f7a14569e9a9bdbed07.tar.bz2
gh-95324: Emit a warning if an object doesn't call PyObject_GC_UnTrack during deallocation in debug mode (#95325)
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index ace0282..4ac90dc 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -57,6 +57,7 @@ lock_traverse(lockobject *self, visitproc visit, void *arg)
static void
lock_dealloc(lockobject *self)
{
+ PyObject_GC_UnTrack(self);
if (self->in_weakreflist != NULL) {
PyObject_ClearWeakRefs((PyObject *) self);
}
@@ -333,6 +334,7 @@ rlock_traverse(rlockobject *self, visitproc visit, void *arg)
static void
rlock_dealloc(rlockobject *self)
{
+ PyObject_GC_UnTrack(self);
if (self->in_weakreflist != NULL)
PyObject_ClearWeakRefs((PyObject *) self);
/* self->rlock_lock can be NULL if PyThread_allocate_lock() failed