@@ -660,6 +660,7 @@ static void
660660PyThreadHandleObject_dealloc (PyObject * op )
661661{
662662 PyThreadHandleObject * self = PyThreadHandleObject_CAST (op );
663+ PyObject_GC_UnTrack (self );
663664 PyTypeObject * tp = Py_TYPE (self );
664665 ThreadHandle_decref (self -> handle );
665666 tp -> tp_free (self );
@@ -747,6 +748,7 @@ static PyType_Slot ThreadHandle_Type_slots[] = {
747748 {Py_tp_dealloc , PyThreadHandleObject_dealloc },
748749 {Py_tp_repr , PyThreadHandleObject_repr },
749750 {Py_tp_getset , ThreadHandle_getsetlist },
751+ {Py_tp_traverse , _PyObject_VisitType },
750752 {Py_tp_methods , ThreadHandle_methods },
751753 {Py_tp_new , PyThreadHandleObject_tp_new },
752754 {0 , 0 }
@@ -756,7 +758,7 @@ static PyType_Spec ThreadHandle_Type_spec = {
756758 "_thread._ThreadHandle" ,
757759 sizeof (PyThreadHandleObject ),
758760 0 ,
759- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE ,
761+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC ,
760762 ThreadHandle_Type_slots ,
761763};
762764
0 commit comments