- explicitly destroy the AltHUD when exiting.

This is to avoid problems with the GC on shutdown.
This commit is contained in:
Christoph Oelckers 2023-01-14 14:09:25 +01:00
parent 6c3d03cd48
commit 1bfccbcb6e
2 changed files with 7 additions and 1 deletions

View file

@ -165,6 +165,7 @@ bool G_Responder(event_t* ev);
void HudScaleChanged();
bool M_SetSpecialMenu(FName& menu, int param);
void OnMenuOpen(bool makeSound);
void DestroyAltHUD();
DStatusBarCore* StatusBar;
@ -622,6 +623,7 @@ int GameMain()
}
//DeleteScreenJob();
if (gi) gi->FreeLevelData();
DestroyAltHUD();
DeinitMenus();
if (StatusBar) StatusBar->Destroy();
StatusBar = nullptr;

View file

@ -134,14 +134,18 @@ static DObject* DoCreateAltHUD(const FName classname)
return althud;
}
void CreateAltHUD()
void DestroyAltHUD()
{
if (AltHud)
{
AltHud->Destroy();
AltHud = nullptr;
}
}
void CreateAltHUD()
{
DestroyAltHUD();
/*
if (!hud_althud_forceinternal)
AltHud = DoCreateAltHUD(gameinfo.althudclass);