Skip to content

Commit

Permalink
Follow-up to preceding commit c643c0d : now that delwin() doesn't rec…
Browse files Browse the repository at this point in the history
…ursively delete subwindows and simply fails if a window still hase subwindows, delscreen() has to go through the window list, possibly repeatedly, until all windows are freed.
  • Loading branch information
Bill-Gray committed Aug 11, 2022
1 parent c643c0d commit 26e473c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pdcurses/initscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,12 @@ void delscreen(SCREEN *sp)
PDC_slk_free(); /* free the soft label keys, if needed */

while( SP->opaque->n_windows)
delwin( SP->opaque->window_list[0]);
{
int i;

for( i = 0; i < SP->opaque->n_windows; i++)
delwin( SP->opaque->window_list[i]);
}
PDC_free_atrtab( );
stdscr = (WINDOW *)NULL;
curscr = (WINDOW *)NULL;
Expand Down

0 comments on commit 26e473c

Please sign in to comment.