File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ insert_lop(PyCursesPanelObject *po)
288288}
289289
290290/* Remove the panel object from lop */
291- static void
291+ static int
292292remove_lop (PyCursesPanelObject * po )
293293{
294294 list_of_panels * temp , * n ;
@@ -297,19 +297,19 @@ remove_lop(PyCursesPanelObject *po)
297297 if (temp -> po == po ) {
298298 lop = temp -> next ;
299299 PyMem_Free (temp );
300- return ;
300+ return 0 ;
301301 }
302302 while (temp -> next == NULL || temp -> next -> po != po ) {
303303 if (temp -> next == NULL ) {
304304 curses_panel_notfound_error ("remove_lop" , NULL );
305- return ;
305+ return -1 ;
306306 }
307307 temp = temp -> next ;
308308 }
309309 n = temp -> next -> next ;
310310 PyMem_Free (temp -> next );
311311 temp -> next = n ;
312- return ;
312+ return 0 ;
313313}
314314
315315/* Return the panel object that corresponds to pan */
@@ -444,7 +444,9 @@ PyCursesPanel_Dealloc(PyObject *self)
444444 }
445445 if (po -> wo != NULL ) {
446446 Py_DECREF (po -> wo );
447- remove_lop (po );
447+ if (remove_lop (po ) < 0 ) {
448+ PyErr_FormatUnraisable ("Exception ignored in PyCursesPanel_Dealloc()" );
449+ }
448450 }
449451 PyObject_Free (po );
450452 Py_DECREF (tp );
You can’t perform that action at this time.
0 commit comments