diff --git a/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp b/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp index 5c90e68e19..9065ccde4b 100644 --- a/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp +++ b/libraries/ZWidget/src/widgets/lineedit/lineedit.cpp @@ -18,6 +18,8 @@ LineEdit::LineEdit(Widget* parent) : Widget(parent) LineEdit::~LineEdit() { + delete timer; + delete scroll_timer; } bool LineEdit::IsReadOnly() const diff --git a/src/common/scripting/core/types.cpp b/src/common/scripting/core/types.cpp index 8e13dcc521..b70783f3e1 100644 --- a/src/common/scripting/core/types.cpp +++ b/src/common/scripting/core/types.cpp @@ -330,7 +330,8 @@ void PType::StaticInit() TypeVoidPtr = NewPointer(TypeVoid, false); TypeRawFunction = new PPointer; - TypeRawFunction->mDescriptiveName = "Raw Function Pointer"; + TypeRawFunction->mDescriptiveName = "Raw Function Pointer"; + TypeTable.AddType(TypeRawFunction, NAME_None); TypeVMFunction = NewPointer(NewStruct("VMFunction", nullptr, true)); TypeColorStruct = NewStruct("@ColorStruct", nullptr); //This name is intentionally obfuscated so that it cannot be used explicitly. The point of this type is to gain access to the single channels of a color value. TypeStringStruct = NewStruct("Stringstruct", nullptr, true); diff --git a/src/common/startscreen/startscreen.cpp b/src/common/startscreen/startscreen.cpp index b71949f469..56a179526a 100644 --- a/src/common/startscreen/startscreen.cpp +++ b/src/common/startscreen/startscreen.cpp @@ -372,6 +372,13 @@ FStartScreen* GetGameStartScreen(int max_progress) return nullptr; } +FStartScreen::~FStartScreen() +{ + if (StartupTexture) delete StartupTexture; + if (HeaderTexture) delete HeaderTexture; + if (NetTexture) delete NetTexture; +} + //========================================================================== // // ST_Util_ClearBlock diff --git a/src/common/startscreen/startscreen.h b/src/common/startscreen/startscreen.h index afac6c7594..c90d092f95 100644 --- a/src/common/startscreen/startscreen.h +++ b/src/common/startscreen/startscreen.h @@ -70,7 +70,7 @@ protected: FGameTexture* NetTexture = nullptr; public: FStartScreen(int maxp) { MaxPos = maxp; } - virtual ~FStartScreen() = default; + virtual ~FStartScreen(); void Render(bool force = false); bool Progress(int); void NetProgress(int count); diff --git a/src/common/widgets/widgetresourcedata.cpp b/src/common/widgets/widgetresourcedata.cpp index 85ee3e2498..13f1519324 100644 --- a/src/common/widgets/widgetresourcedata.cpp +++ b/src/common/widgets/widgetresourcedata.cpp @@ -21,6 +21,7 @@ void InitWidgetResources(const char* filename) void CloseWidgetResources() { if (WidgetResources) delete WidgetResources; + WidgetResources = nullptr; } static std::vector LoadFile(const char* name) diff --git a/src/d_main.cpp b/src/d_main.cpp index fb25fa00fb..c00f2231c5 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -161,6 +161,7 @@ bool M_SetSpecialMenu(FName& menu, int param); // game specific checks const FIWADInfo *D_FindIWAD(TArray &wadfiles, const char *iwad, const char *basewad); void InitWidgetResources(const char* basewad); +void CloseWidgetResources(); // PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- @@ -3844,6 +3845,7 @@ int GameMain() M_SaveDefaultsFinal(); DeleteStartupScreen(); C_UninitCVars(); // must come last so that nothing will access the CVARs anymore after deletion. + CloseWidgetResources(); delete Args; Args = nullptr; return ret;