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: Thomas Dickey
Subject: Re: delwin() and deleting windows with subwindows
Date: Sat, 13 Aug 2022 19:20:16 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, Aug 11, 2022 at 10:31:43PM -0400, Bill Gray wrote:
> On 8/11/22 17:53, G. Branden Robinson wrote:
> > At 2022-08-11T12:35:49-0400, Bill Gray wrote:
> > >     Delete subwindows recursively,  and that access attempts to read
> > >     freed memory.  One shouldn't be doing such things;  once a parent
> > >     window is deleted,  you shouldn't try to do anything with the
> > >     subwindow.  But I'll bet you that some code does so,  and recursive
> > >     deletion would break that code.
> > 
> > Why not implement recursive deletion for now, and see if anything
> > squawks?  Any application that chases pointers into freed memory is
> > surely busted at a fundamental level, quite apart from violating the
> > documented assumptions of the XSI Curses spec.
> 
>    I was tempted to keep recursive deletion (the code was all written and
> tested),  but I've chickened out.

good idea :-)

Actually, as I recall it, I didn't do that for delwin because it seemed
problematic for layout.

But delscreen is supposed to work.  Following up on your test case, I see
that was neglected (the debugging-features that I generally use hid the
leaks in delscreen).

Today I made a modified test-program which made it simple(r) to fix that.

fwiw, NetBSD curses hangs (infinite loop) on the first delwin in your
example, while Solaris dumps core on the last delwin.
 
-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

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