follow-up for --showpaths
Ensure that memory allocations are freed up. Windows: Fix a Windows compiler warning. Fix an undefined link symbol.
This commit is contained in:
@@ -342,7 +342,7 @@ struct instance_globals_d {
|
|||||||
|
|
||||||
/* new */
|
/* new */
|
||||||
boolean deferred_showpaths;
|
boolean deferred_showpaths;
|
||||||
const char *deferred_showpaths_dir;
|
char *deferred_showpaths_dir;
|
||||||
|
|
||||||
boolean havestate;
|
boolean havestate;
|
||||||
unsigned long magic; /* validate that structure layout is preserved */
|
unsigned long magic; /* validate that structure layout is preserved */
|
||||||
|
|||||||
@@ -4482,12 +4482,19 @@ do_deferred_showpaths(int code)
|
|||||||
gd.deferred_showpaths = FALSE;
|
gd.deferred_showpaths = FALSE;
|
||||||
reveal_paths(code);
|
reveal_paths(code);
|
||||||
|
|
||||||
|
/* cleanup before heading to an exit */
|
||||||
|
freedynamicdata();
|
||||||
|
dlb_cleanup();
|
||||||
|
l_nhcore_done();
|
||||||
|
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
after_opt_showpaths(gd.deferred_showpaths_dir);
|
after_opt_showpaths(gd.deferred_showpaths_dir);
|
||||||
#else
|
#else
|
||||||
|
#ifndef WIN32
|
||||||
#ifdef CHDIR
|
#ifdef CHDIR
|
||||||
chdirx(gd.deferred_showpaths_dir, 0);
|
chdirx(gd.deferred_showpaths_dir, 0);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#if defined(WIN32) || defined(MICRO) || defined(OS2)
|
#if defined(WIN32) || defined(MICRO) || defined(OS2)
|
||||||
nethack_exit(EXIT_SUCCESS);
|
nethack_exit(EXIT_SUCCESS);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1278,6 +1278,9 @@ freedynamicdata(void)
|
|||||||
if (options_set_window_colors_flag)
|
if (options_set_window_colors_flag)
|
||||||
options_free_window_colors();
|
options_free_window_colors();
|
||||||
|
|
||||||
|
if (glyphid_cache_status())
|
||||||
|
free_glyphid_cache();
|
||||||
|
|
||||||
/* last, because it frees data that might be used by panic() to provide
|
/* last, because it frees data that might be used by panic() to provide
|
||||||
feedback to the user; conceivably other freeing might trigger panic */
|
feedback to the user; conceivably other freeing might trigger panic */
|
||||||
sysopt_release(); /* SYSCF strings */
|
sysopt_release(); /* SYSCF strings */
|
||||||
|
|||||||
Reference in New Issue
Block a user