[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: delwin() and deleting windows with subwindows
From: |
Thomas Dickey |
Subject: |
Re: delwin() and deleting windows with subwindows |
Date: |
Sun, 14 Aug 2022 17:27:15 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sun, Aug 14, 2022 at 03:14:59PM -0400, Bill Gray wrote:
> On 8/13/22 19:20, Thomas Dickey wrote:
> > On Thu, Aug 11, 2022 at 10:31:43PM -0400, Bill Gray wrote:
> > > I was tempted to keep recursive deletion (the code was all written and
> > > tested), but I've chickened out.
> >
> > good idea :-)
>
> (Hangs head) Yeah, I got a little carried away when I pushed the
> recursive-deletion version.
no problem (I should have checked the test program before updating
the manpage -- memory isn't good on ~20 year old changes).
> > Today I made a modified test-program which made it simple(r) to fix that.
>
> The PDCurses makefiles can build a subset of ncurses test programs;
> PDCursesMod has a larger subset, to which I've added test_delwin.
sounds good ...
> > fwiw, NetBSD curses hangs (infinite loop) on the first delwin in your
> > example, while Solaris dumps core on the last delwin.
>
> Well, that's interesting. It sounds as if trying to delete parent
> windows should be strongly discouraged. I can't think of a case where you
at least it's not done often enough for someone to report a problem with
NetBSD ;-)
> would legitimately try to delete a parent window anyway. If you try, you
> probably have a bug in your code. (Similarly if you try to delwin() a
> window twice or delwin() a NULL pointer.)
>
> I've modified PDCursesMod so that in debug builds, deleting a parent
> window triggers an assert(). Better that, I think, than letting things
> proceed and probably crash later on.
>
> -- Bill
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature