]> granicus.if.org Git - nethack/commit
curses message recall, memory leaks
authorPatR <rankin@nethack.org>
Mon, 25 Mar 2019 00:50:26 +0000 (17:50 -0700)
committerPatR <rankin@nethack.org>
Mon, 25 Mar 2019 00:50:26 +0000 (17:50 -0700)
commitee53a9fea6be8fe4c3173784bea2a129a0fdd447
tree1c6fce03a8588887cd20a6860a2b207579edc279
parent804a4f1846703ce19fd7c9a4f4e1135a0e812b5c
curses message recall, memory leaks

Using ^P right after resize or 'O' of align_message, align_status,
statuslines, or windowborders would result in
'curses_display_nhmenu: attempt to display empty menu'
because some memory cleanup I added several weeks back was being
executed when the curses interface tore down and recreated its
internal windows.

This fixes ^P handling by making sure that that menu (which is just
text but uses a menu to support '>'/'<'/'^'/'|' scrolling) will never
be empty and it also fixes the window deletion to not throw away
message history until it's final deletion at exit time.

^P uses a popup window to display previous messages and it was never
deleting that window, just creating a new one each time.  Same with
the routine which displays an external help file.  Using either or
combination of both close to 5000 times would probably make internal
window creation get stuck in an infinite loop.  Delete those windows
after they're used so it'll never be put to the test.

The memory cleanup I added for map/status/messages/invent was only
being preformed at end of game, not when saving.  Fix that too.
doc/fixes36.2
include/wincurs.h
win/curses/cursdial.c
win/curses/cursdial.h
win/curses/cursinit.c
win/curses/cursmain.c
win/curses/cursmesg.c
win/curses/cursmisc.c
win/curses/cursstat.c
win/curses/curswins.c
win/curses/curswins.h