]> granicus.if.org Git - nethack/commit
window cleanup at exit
authorPatR <rankin@nethack.org>
Sun, 15 Nov 2015 08:32:56 +0000 (00:32 -0800)
committerPatR <rankin@nethack.org>
Sun, 15 Nov 2015 08:32:56 +0000 (00:32 -0800)
commitd813c6f0eef0d859c9efee4cbe5dcd4ddeecc5e0
tree1a0e8e65402bc739def259baf05331f5d9fa960a
parentb2ab8f25047855b9b678d89fb756406d581b6704
window cleanup at exit

exit_nhwindows() is called before terminate(), and the tty incarnation
destroys all windows--including 'pickinv_cache_win'--without setting
the various index variables used to access them to WIN_ERR, then
terminate() calls freedynamicdata() which calls free_pickinv_cache()
which tries to destroy 'pickinv_cache_win' since it isn't WIN_ERR (if
the perm_invent option has been enabled during that playing session).
Some of the other <interface>_exit_nhwindows() also tear things down
without resetting the variables used to track them, so fixing this in
exit_nhwindows() would have been pretty messy.

Call free_pickinv_cache() before exit_nhwindows() in done().  At the
moment it's only called from done(), so other exit paths won't release
the small chunk(s) of memory used for the alternate inventory window
(if it got created for perm_invent support).
src/end.c
src/invent.c
src/save.c