]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_freeall.c
ncurses 6.3 - patch 20211106
[ncurses.git] / ncurses / base / lib_freeall.c
index 4e29ec0f632f514efea4c58241048311f0ddefbc..75bbe77e34093be4c4efa70b4a40f18da2abaac1 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +40,7 @@
 extern int malloc_errfd;       /* FIXME */
 #endif
 
-MODULE_ID("$Id: lib_freeall.c,v 1.71 2019/12/15 00:30:49 tom Exp $")
+MODULE_ID("$Id: lib_freeall.c,v 1.76 2021/11/06 21:52:49 tom Exp $")
 
 /*
  * Free all ncurses data.  This is used for testing only (there's no practical
@@ -77,6 +78,9 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0)
                WINDOW *p_win = &(p->win);
                bool found = FALSE;
 
+               if (IS_PAD(p_win))
+                   continue;
+
 #ifndef USE_SP_WINDOWLIST
                if (p->screen != SP_PARM)
                    continue;
@@ -91,7 +95,7 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0)
 #endif
 
                    if ((p != q)
-                       && (q_win->_flags & _SUBWIN)
+                       && IS_SUBWIN(q_win)
                        && (p_win == q_win->_parent)) {
                        found = TRUE;
                        break;
@@ -170,8 +174,6 @@ NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code)
 {
     if (SP_PARM) {
        delscreen(SP_PARM);
-       if (SP_PARM->_term)
-           NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx SP_PARM->_term);
     }
     exit(code);
 }