@@ -660,6 +660,7 @@ static void
660
660
PyThreadHandleObject_dealloc (PyObject * op )
661
661
{
662
662
PyThreadHandleObject * self = PyThreadHandleObject_CAST (op );
663
+ PyObject_GC_UnTrack (self );
663
664
PyTypeObject * tp = Py_TYPE (self );
664
665
ThreadHandle_decref (self -> handle );
665
666
tp -> tp_free (self );
@@ -747,6 +748,7 @@ static PyType_Slot ThreadHandle_Type_slots[] = {
747
748
{Py_tp_dealloc , PyThreadHandleObject_dealloc },
748
749
{Py_tp_repr , PyThreadHandleObject_repr },
749
750
{Py_tp_getset , ThreadHandle_getsetlist },
751
+ {Py_tp_traverse , _PyObject_VisitType },
750
752
{Py_tp_methods , ThreadHandle_methods },
751
753
{Py_tp_new , PyThreadHandleObject_tp_new },
752
754
{0 , 0 }
@@ -756,7 +758,7 @@ static PyType_Spec ThreadHandle_Type_spec = {
756
758
"_thread._ThreadHandle" ,
757
759
sizeof (PyThreadHandleObject ),
758
760
0 ,
759
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE ,
761
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC ,
760
762
ThreadHandle_Type_slots ,
761
763
};
762
764
0 commit comments