@@ -1317,6 +1317,8 @@ map_node_bitmap_dealloc(MapNode_Bitmap *self)
1317
1317
{
1318
1318
/* Bitmap's tp_dealloc */
1319
1319
1320
+ PyTypeObject * tp = Py_TYPE (self );
1321
+
1320
1322
Py_ssize_t len = Py_SIZE (self );
1321
1323
Py_ssize_t i ;
1322
1324
@@ -1330,8 +1332,10 @@ map_node_bitmap_dealloc(MapNode_Bitmap *self)
1330
1332
}
1331
1333
}
1332
1334
1333
- Py_TYPE ( self ) -> tp_free (( PyObject * ) self );
1335
+ PyObject_GC_Del ( self );
1334
1336
Py_TRASHCAN_END
1337
+
1338
+ Py_DECREF (tp );
1335
1339
}
1336
1340
1337
1341
static int
@@ -1747,6 +1751,8 @@ map_node_collision_dealloc(MapNode_Collision *self)
1747
1751
{
1748
1752
/* Collision's tp_dealloc */
1749
1753
1754
+ PyTypeObject * tp = Py_TYPE (self );
1755
+
1750
1756
Py_ssize_t len = Py_SIZE (self );
1751
1757
1752
1758
PyObject_GC_UnTrack (self );
@@ -1759,8 +1765,10 @@ map_node_collision_dealloc(MapNode_Collision *self)
1759
1765
}
1760
1766
}
1761
1767
1762
- Py_TYPE ( self ) -> tp_free (( PyObject * ) self );
1768
+ PyObject_GC_Del ( self );
1763
1769
Py_TRASHCAN_END
1770
+
1771
+ Py_DECREF (tp );
1764
1772
}
1765
1773
1766
1774
static int
@@ -2174,6 +2182,8 @@ map_node_array_dealloc(MapNode_Array *self)
2174
2182
{
2175
2183
/* Array's tp_dealloc */
2176
2184
2185
+ PyTypeObject * tp = Py_TYPE (self );
2186
+
2177
2187
Py_ssize_t i ;
2178
2188
2179
2189
PyObject_GC_UnTrack (self );
@@ -2183,8 +2193,10 @@ map_node_array_dealloc(MapNode_Array *self)
2183
2193
Py_XDECREF (self -> a_array [i ]);
2184
2194
}
2185
2195
2186
- Py_TYPE ( self ) -> tp_free (( PyObject * ) self );
2196
+ PyObject_GC_Del ( self );
2187
2197
Py_TRASHCAN_END
2198
+
2199
+ Py_DECREF (tp );
2188
2200
}
2189
2201
2190
2202
static int
@@ -2764,9 +2776,11 @@ map_baseiter_tp_clear(MapIterator *it)
2764
2776
static void
2765
2777
map_baseiter_tp_dealloc (MapIterator * it )
2766
2778
{
2779
+ PyTypeObject * tp = Py_TYPE (it );
2767
2780
PyObject_GC_UnTrack (it );
2768
2781
(void )map_baseiter_tp_clear (it );
2769
2782
PyObject_GC_Del (it );
2783
+ Py_DECREF (tp );
2770
2784
}
2771
2785
2772
2786
static int
@@ -2811,9 +2825,11 @@ map_baseview_tp_clear(MapView *view)
2811
2825
static void
2812
2826
map_baseview_tp_dealloc (MapView * view )
2813
2827
{
2828
+ PyTypeObject * tp = Py_TYPE (view );
2814
2829
PyObject_GC_UnTrack (view );
2815
2830
(void )map_baseview_tp_clear (view );
2816
2831
PyObject_GC_Del (view );
2832
+ Py_DECREF (tp );
2817
2833
}
2818
2834
2819
2835
static int
@@ -3139,10 +3155,12 @@ map_tp_traverse(BaseMapObject *self, visitproc visit, void *arg)
3139
3155
static void
3140
3156
map_tp_dealloc (BaseMapObject * self )
3141
3157
{
3158
+ PyTypeObject * tp = Py_TYPE (self );
3142
3159
PyObject_GC_UnTrack (self );
3143
3160
PyObject_ClearWeakRefs ((PyObject * )self );
3144
3161
(void )map_tp_clear (self );
3145
- Py_TYPE (self )-> tp_free (self );
3162
+ PyObject_GC_Del (self );
3163
+ Py_DECREF (tp );
3146
3164
}
3147
3165
3148
3166
0 commit comments