release some memory before exit under Windows
This commit is contained in:
@@ -1128,8 +1128,6 @@ consoletty_open(int mode)
|
||||
void
|
||||
consoletty_exit(void)
|
||||
{
|
||||
/* frees some status tracking data */
|
||||
genl_status_finish();
|
||||
/* go back to using the safe routines */
|
||||
safe_routines();
|
||||
free_custom_colors();
|
||||
|
||||
@@ -499,8 +499,9 @@ extern const char *known_restrictions[]; /* symbols.c */
|
||||
|
||||
DISABLE_WARNING_UNREACHABLE_CODE
|
||||
|
||||
#if defined(__MINGW32__) && defined(MSWIN_GRAPHICS)
|
||||
#define MAIN mingw_main
|
||||
|
||||
#if defined(MSWIN_GRAPHICS)
|
||||
#define MAIN nethackw_main
|
||||
#else
|
||||
#define MAIN main
|
||||
#endif
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user