Delete fighter stats. Close SDL window last.

This commit is contained in:
Steve 2017-11-24 08:25:48 +00:00
parent 0e7b08c283
commit 7d601f6e8e
3 changed files with 19 additions and 3 deletions

View File

@ -1075,3 +1075,15 @@ void destroyFighterDefs(void)
free(e); free(e);
} }
} }
void destroyFighterStats(void)
{
Tuple *t;
while (game.fighterStatHead.next)
{
t = game.fighterStatHead.next;
game.fighterStatHead.next = t->next;
free(t);
}
}

View File

@ -338,9 +338,6 @@ void cleanup(void)
{ {
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Cleaning up ..."); SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Cleaning up ...");
SDL_DestroyRenderer(app.renderer);
SDL_DestroyWindow(app.window);
destroyLookups(); destroyLookups();
destroyTextures(); destroyTextures();
@ -373,10 +370,16 @@ void cleanup(void)
destroyFighterDatabase(); destroyFighterDatabase();
destroyFighterStats();
destroyCredits(); destroyCredits();
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Done"); SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Done");
SDL_DestroyRenderer(app.renderer);
SDL_DestroyWindow(app.window);
TTF_Quit(); TTF_Quit();
SDL_Quit(); SDL_Quit();

View File

@ -64,6 +64,7 @@ extern void destroyGalacticMap(void);
extern void destroyWidgets(void); extern void destroyWidgets(void);
extern void destroyResources(void); extern void destroyResources(void);
extern void destroyFighterDatabase(void); extern void destroyFighterDatabase(void);
extern void destroyFighterStats(void);
extern void expireTexts(int all); extern void expireTexts(int all);
extern void initInput(void); extern void initInput(void);
extern void initModalDialog(void); extern void initModalDialog(void);