Fix refleaks in new unicodedata classes added in gh-74902 (GH-143843)

This commit is contained in:
Serhiy Storchaka 2026-01-14 21:55:11 +02:00 committed by GitHub
parent 14f96a8d8f
commit 85013d7a55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1885,9 +1885,11 @@ typedef struct {
static void
Segment_dealloc(PyObject *self)
{
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);
Py_DECREF(((SegmentObject *)self)->string);
PyObject_GC_Del(self);
tp->tp_free(self);
Py_DECREF(tp);
}
static int
@ -1959,9 +1961,11 @@ typedef struct {
static void
GBI_dealloc(PyObject *self)
{
PyTypeObject *tp = Py_TYPE(self);
PyObject_GC_UnTrack(self);
Py_DECREF(((GraphemeBreakIterator *)self)->iter.str);
PyObject_GC_Del(self);
tp->tp_free(self);
Py_DECREF(tp);
}
static int