X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Fwresize.c;h=e441b669d7c6b2bcf68616d78ea78b986c9a2008;hp=ca6336dc94b5d2d14a10d153a2c87190e9007075;hb=26522e4669dbf45cba32138b5d81c6c292e88e60;hpb=027ae42953e3186daed8f3882da73de48291b606 diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c index ca6336dc..e441b669 100644 --- a/ncurses/base/wresize.c +++ b/ncurses/base/wresize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -27,18 +27,19 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996-2002 * + * Author: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ #include -MODULE_ID("$Id: wresize.c,v 1.24 2006/10/14 20:43:31 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.31 2009/05/23 19:50:16 tom Exp $") static int cleanup_lines(struct ldat *data, int length) { while (--length >= 0) - free(data->text); + free(data[length].text); free(data); return ERR; } @@ -53,8 +54,13 @@ repair_subwindows(WINDOW *cmp) WINDOWLIST *wp; struct ldat *pline = cmp->_line; int row; +#ifdef USE_SP_WINDOWLIST + SCREEN *sp = _nc_screen_of(cmp); +#endif + + _nc_lock_global(curses); - for (wp = _nc_windows; wp != 0; wp = wp->next) { + for (each_window(SP_PARM, wp)) { WINDOW *tst = &(wp->win); if (tst->_parent == cmp) { @@ -75,6 +81,7 @@ repair_subwindows(WINDOW *cmp) repair_subwindows(tst); } } + _nc_unlock_global(curses); } /* @@ -96,8 +103,10 @@ wresize(WINDOW *win, int ToLines, int ToCols) (long) win->_begy, (long) win->_begx, (long) win->_maxy, (long) win->_maxx, (long) win->_regtop, (long) win->_regbottom)); - if (_nc_tracing & TRACE_UPDATE) + if (USE_TRACEF(TRACE_UPDATE)) { _tracedump("...before", win); + _nc_unlock_global(tracef); + } } #endif @@ -232,8 +241,10 @@ wresize(WINDOW *win, int ToLines, int ToCols) (long) win->_begy, (long) win->_begx, (long) win->_maxy, (long) win->_maxx, (long) win->_regtop, (long) win->_regbottom)); - if (_nc_tracing & TRACE_UPDATE) + if (USE_TRACEF(TRACE_UPDATE)) { _tracedump("...after:", win); + _nc_unlock_global(tracef); + } #endif returnCode(OK); }