Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix refleaks in new unicodedata classes added in gh-74902
  • Loading branch information
serhiy-storchaka committed Jan 14, 2026
commit 6a1688fb261548080c1f925ea7e2602234003fbc
8 changes: 6 additions & 2 deletions Modules/unicodedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading