mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
#18113: Objects associated to a curses.panel object with set_userptr() were leaked.
Reported by Atsuo Ishimoto.
This commit is contained in:
parent
27bbfdbc4c
commit
53e5ea7951
3 changed files with 20 additions and 0 deletions
|
@ -322,6 +322,10 @@ PyCursesPanel_replace_panel(PyCursesPanelObject *self, PyObject *args)
|
|||
static PyObject *
|
||||
PyCursesPanel_set_panel_userptr(PyCursesPanelObject *self, PyObject *obj)
|
||||
{
|
||||
PyObject *oldobj;
|
||||
PyCursesInitialised;
|
||||
oldobj = (PyObject *) panel_userptr(self->pan);
|
||||
Py_XDECREF(oldobj);
|
||||
Py_INCREF(obj);
|
||||
return PyCursesCheckERR(set_panel_userptr(self->pan, (void*)obj),
|
||||
"set_panel_userptr");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue