summaryrefslogtreecommitdiffstats
path: root/Modules/_curses_panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_curses_panel.c')
-rw-r--r--Modules/_curses_panel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index 87b9c05..759b731 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -312,9 +312,8 @@ PyCursesPanel_replace_panel(PyCursesPanelObject *self, PyObject *args)
PyErr_SetString(_curses_panelstate_global->PyCursesError, "replace_panel() returned ERR");
return NULL;
}
- Py_DECREF(po->wo);
- po->wo = temp;
- Py_INCREF(po->wo);
+ Py_INCREF(temp);
+ Py_SETREF(po->wo, temp);
Py_INCREF(Py_None);
return Py_None;
}