Skip to content
Merged
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,8 @@
}
}

PyCursesWindowObject *wo = PyObject_New(PyCursesWindowObject, state->window_type);
PyCursesWindowObject *wo = PyObject_GC_New(PyCursesWindowObject,
state->window_type);
if (wo == NULL) {
return NULL;
}
Expand All @@ -780,13 +781,15 @@
PyErr_NoMemory();
return NULL;
}
PyObject_GC_Track((PyObject *)wo);
return (PyObject *)wo;
}

static void
PyCursesWindow_dealloc(PyObject *self)
{
PyTypeObject *window_type = Py_TYPE(self);
PyObject_GC_Untrack(self);

Check failure on line 792 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-22.04)

implicit declaration of function ‘PyObject_GC_Untrack’; did you mean ‘PyObject_GC_UnTrack’? [-Werror=implicit-function-declaration]

Check failure on line 792 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

implicit declaration of function ‘PyObject_GC_Untrack’; did you mean ‘PyObject_GC_UnTrack’? [-Werror=implicit-function-declaration]

Check failure on line 792 in Modules/_cursesmodule.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

implicit declaration of function ‘PyObject_GC_Untrack’; did you mean ‘PyObject_GC_UnTrack’? [-Werror=implicit-function-declaration]
PyCursesWindowObject *wo = (PyCursesWindowObject *)self;
if (wo->win != stdscr && wo->win != NULL) {
// silently ignore errors in delwin(3)
Expand Down Expand Up @@ -2694,7 +2697,8 @@
.flags = Py_TPFLAGS_DEFAULT
| Py_TPFLAGS_DISALLOW_INSTANTIATION
| Py_TPFLAGS_IMMUTABLETYPE
| Py_TPFLAGS_HEAPTYPE,
| Py_TPFLAGS_HEAPTYPE
| Py_TPFLAGS_HAVE_GC,
.slots = PyCursesWindow_Type_slots
};

Expand Down
Loading