@@ -866,13 +866,12 @@ Compressor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
866866static void
867867Compressor_dealloc (PyObject * op )
868868{
869- PyTypeObject * tp = Py_TYPE (op );
870- PyObject_GC_UnTrack (op );
871869 Compressor * self = Compressor_CAST (op );
872870 lzma_end (& self -> lzs );
873871 if (self -> lock != NULL ) {
874872 PyThread_free_lock (self -> lock );
875873 }
874+ PyTypeObject * tp = Py_TYPE (self );
876875 tp -> tp_free (self );
877876 Py_DECREF (tp );
878877}
@@ -934,7 +933,7 @@ static PyType_Spec lzma_compressor_type_spec = {
934933 // lzma_compressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
935934 // which prevents to create a subclass.
936935 // So calling PyType_GetModuleState() in this file is always safe.
937- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC ),
936+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE ),
938937 .slots = lzma_compressor_type_slots ,
939938};
940939
@@ -1315,8 +1314,6 @@ _lzma_LZMADecompressor_impl(PyTypeObject *type, int format,
13151314static void
13161315Decompressor_dealloc (PyObject * op )
13171316{
1318- PyTypeObject * tp = Py_TYPE (op );
1319- PyObject_GC_UnTrack (op );
13201317 Decompressor * self = Decompressor_CAST (op );
13211318 if (self -> input_buffer != NULL )
13221319 PyMem_Free (self -> input_buffer );
@@ -1326,6 +1323,7 @@ Decompressor_dealloc(PyObject *op)
13261323 if (self -> lock != NULL ) {
13271324 PyThread_free_lock (self -> lock );
13281325 }
1326+ PyTypeObject * tp = Py_TYPE (self );
13291327 tp -> tp_free (self );
13301328 Py_DECREF (tp );
13311329}
@@ -1383,7 +1381,7 @@ static PyType_Spec lzma_decompressor_type_spec = {
13831381 // lzma_decompressor_type_spec does not have Py_TPFLAGS_BASETYPE flag
13841382 // which prevents to create a subclass.
13851383 // So calling PyType_GetModuleState() in this file is always safe.
1386- .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_HAVE_GC ),
1384+ .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE ),
13871385 .slots = lzma_decompressor_type_slots ,
13881386};
13891387
0 commit comments