]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_delwin.c
ncurses 6.3 - patch 20221210
[ncurses.git] / ncurses / base / lib_delwin.c
index efaf4ee112fe437347063c29b602d61c824c323b..1136305afb3e9940ad369efbec04fde86fe41816 100644 (file)
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_delwin.c,v 1.22 2021/11/06 21:54:14 tom Exp $")
+MODULE_ID("$Id: lib_delwin.c,v 1.24 2021/12/11 23:56:25 tom Exp $")
 
 static bool
 cannot_delete(WINDOW *win)
 {
-    WINDOWLIST *p;
     bool result = TRUE;
+
     if (IS_PAD(win)) {
        result = FALSE;
     } else {
+       WINDOWLIST *p;
 #ifdef USE_SP_WINDOWLIST
        SCREEN *sp = _nc_screen_of(win);
 #endif
@@ -83,7 +84,7 @@ delwin(WINDOW *win)
            result = ERR;
        } else if (IS_PAD(win)) {
            win->_parent = NULL;
-           result = OK;
+           result = _nc_freewin(win);
        } else {
 #if NCURSES_SP_FUNCS
            SCREEN *sp = _nc_screen_of(win);