fix memory leaks for #quit while in tutorial

The new change to reset discoveries and monster-stats when exiting
the tutorial used dynamic data which wouldn't be freed if player
used #quit and declined to resume the regular game.

It turns out that such a leak was already present for start-of-game
inventory that gets stashed away during the tutorial.

In both cases, it could happen at most once per game so wasn't a big
deal as far as memory leaks go.
This commit is contained in:
PatR
2024-03-21 15:28:13 -07:00
parent a8fbb96f2b
commit 9ba0cf2ff0
5 changed files with 94 additions and 44 deletions

View File

@@ -404,6 +404,11 @@ static const struct instance_globals_g g_init_g = {
{ UNDEFINED_VALUES }, /* gems */
/* invent.c */
0L, /* glyph_reset_timestamp */
/* nhlua.c */
FALSE, /* gmst_stored */
0L, /* gmst_moves */
NULL, /* gmst_invent */
NULL, NULL, NULL, /* gmst_ubak, gmst_disco, gmst_mvitals */
/* pline.c */
UNDEFINED_PTR, /* gamelog */
/* region.c */