free the WidgetResources file on shutdown to reduce the number of reported memory leaks.

This commit is contained in:
Christoph Oelckers 2024-01-06 14:42:36 +01:00
parent 218a617e6b
commit 9e7785e44c
2 changed files with 7 additions and 0 deletions

View file

@ -12,6 +12,11 @@ void InitWidgetResources(const char* filename)
I_FatalError("Unable to open %s", filename);
}
void CloseWidgetResources()
{
if (WidgetResources) delete WidgetResources;
}
static std::vector<uint8_t> LoadFile(const std::string& name)
{
auto lump = WidgetResources->FindEntry(name.c_str());

View file

@ -90,6 +90,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void LoadHexFont(const char* filename);
void InitWidgetResources(const char* basewad);
void CloseWidgetResources();
CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -663,6 +664,7 @@ int GameMain()
gi = nullptr;
}
DeleteStartupScreen();
CloseWidgetResources();
PClass::StaticShutdown();
C_UninitCVars();
if (Args) delete Args;