Issue #25745: Fixed leaking a userptr in curses panel destructor.

This commit is contained in:
Serhiy Storchaka 2016-05-09 00:11:59 +03:00
parent 02d9f5e5b2
commit df40b62390
2 changed files with 7 additions and 0 deletions

View file

@ -220,6 +220,11 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo)
static void
PyCursesPanel_Dealloc(PyCursesPanelObject *po)
{
PyObject *obj = (PyObject *) panel_userptr(po->pan);
if (obj) {
(void)set_panel_userptr(po->pan, NULL);
Py_DECREF(obj);
}
(void)del_panel(po->pan);
if (po->wo != NULL) {
Py_DECREF(po->wo);