release some memory before exit under Windows

This commit is contained in:
nhmall
2024-11-11 16:50:57 -05:00
parent fd0b67de4d
commit 7414b906b2
4 changed files with 35 additions and 17 deletions

View File

@@ -483,6 +483,10 @@ get_port_id(char *buf)
}
#endif /* RUNTIME_PORT_ID */
#ifdef MSWIN_GRAPHICS
extern void free_winmain_stuff(void);
#endif
void
nethack_exit(int code)
{
@@ -506,6 +510,11 @@ nethack_exit(int code)
if (iflags.window_inited)
wait_synch();
}
/* frees some status tracking data */
genl_status_finish();
#ifdef MSWIN_GRAPHICS
free_winmain_stuff();
#endif
exit(code);
}