/****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2020-2021,2023 Thomas E. Dickey *
* Copyright 1998-2008,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#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.25 2023/10/21 11:12:44 tom Exp $")
static bool
cannot_delete(WINDOW *win)
{
- WINDOWLIST *p;
bool result = TRUE;
+
if (IS_PAD(win)) {
result = FALSE;
} else {
-#ifdef USE_SP_WINDOWLIST
+ WINDOWLIST *p;
+#if NCURSES_SP_FUNCS && defined(USE_SP_WINDOWLIST)
SCREEN *sp = _nc_screen_of(win);
#endif
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);