bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delwin() and deleting windows with subwindows


From: Bill Gray
Subject: Re: delwin() and deleting windows with subwindows
Date: Sun, 14 Aug 2022 15:14:59 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

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.

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.

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 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]