diff --git a/source/common/filesystem/source/fs_stringpool.h b/source/common/filesystem/source/fs_stringpool.h index 199a3483b6..f327d14a3e 100644 --- a/source/common/filesystem/source/fs_stringpool.h +++ b/source/common/filesystem/source/fs_stringpool.h @@ -8,7 +8,7 @@ class StringPool friend class FileSystem; friend class FResourceFile; private: - StringPool(bool _shared, size_t blocksize = 10*1024) : TopBlock(nullptr), FreeBlocks(nullptr), BlockSize(blocksize), shared(_shared) {} + StringPool(bool _shared, size_t blocksize = 10*1024) : TopBlock(nullptr), BlockSize(blocksize), shared(_shared) {} public: ~StringPool(); const char* Strdup(const char*); @@ -20,7 +20,6 @@ class StringPool Block *AddBlock(size_t size); Block *TopBlock; - Block *FreeBlocks; size_t BlockSize; public: bool shared; diff --git a/source/common/widgets/widgetresourcedata.cpp b/source/common/widgets/widgetresourcedata.cpp index 84822fc868..fd416e1d11 100644 --- a/source/common/widgets/widgetresourcedata.cpp +++ b/source/common/widgets/widgetresourcedata.cpp @@ -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 LoadFile(const std::string& name) { auto lump = WidgetResources->FindEntry(name.c_str()); diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 7357eb9343..cf67e7e41b 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -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) @@ -1050,6 +1051,7 @@ int RunGame() GetGames(); auto usedgroups = SetupGame(); + CloseWidgetResources(); V_InitScreenSize(); V_InitScreen(); V_Init2();