try to deal with subwindow deletion
[unix-history] / usr / src / lib / libcurses / delwin.c
... / ...
CommitLineData
1# include "curses.ext"
2
3/*
4 * This routine deletes a window and releases it back to the system.
5 *
6 * %G% (Berkeley) @(#)delwin.c 1.4
7 */
8delwin(win)
9reg WINDOW *win; {
10
11 reg int i;
12 reg WINDOW *wp, *np;
13
14 if (win->_orig == NULL) {
15 for (i = 0; i < win->_maxy && win->_y[i]; i++)
16 cfree(win->_y[i]);
17 wp = win->_nextp;
18 while (wp != win) {
19 np = wp->_nextp;
20 delwin(wp);
21 wp = np;
22 }
23 }
24 cfree(win->_y);
25 cfree(win->_firstch);
26 cfree(win->_lastch);
27 cfree(win);
28}