mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 11:41:03 +00:00
fixed a few memory leaks
This commit is contained in:
parent
2b2e85005c
commit
f0676cdf01
6 changed files with 15 additions and 2 deletions
|
@ -18,6 +18,8 @@ LineEdit::LineEdit(Widget* parent) : Widget(parent)
|
|||
|
||||
LineEdit::~LineEdit()
|
||||
{
|
||||
delete timer;
|
||||
delete scroll_timer;
|
||||
}
|
||||
|
||||
bool LineEdit::IsReadOnly() const
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -21,6 +21,7 @@ void InitWidgetResources(const char* filename)
|
|||
void CloseWidgetResources()
|
||||
{
|
||||
if (WidgetResources) delete WidgetResources;
|
||||
WidgetResources = nullptr;
|
||||
}
|
||||
|
||||
static std::vector<uint8_t> LoadFile(const char* name)
|
||||
|
|
|
@ -161,6 +161,7 @@ bool M_SetSpecialMenu(FName& menu, int param); // game specific checks
|
|||
|
||||
const FIWADInfo *D_FindIWAD(TArray<FString> &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;
|
||||
|
|
Loading…
Reference in a new issue