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()
|
LineEdit::~LineEdit()
|
||||||
{
|
{
|
||||||
|
delete timer;
|
||||||
|
delete scroll_timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LineEdit::IsReadOnly() const
|
bool LineEdit::IsReadOnly() const
|
||||||
|
|
|
@ -330,7 +330,8 @@ void PType::StaticInit()
|
||||||
|
|
||||||
TypeVoidPtr = NewPointer(TypeVoid, false);
|
TypeVoidPtr = NewPointer(TypeVoid, false);
|
||||||
TypeRawFunction = new PPointer;
|
TypeRawFunction = new PPointer;
|
||||||
TypeRawFunction->mDescriptiveName = "Raw Function Pointer";
|
TypeRawFunction->mDescriptiveName = "Raw Function Pointer";
|
||||||
|
TypeTable.AddType(TypeRawFunction, NAME_None);
|
||||||
TypeVMFunction = NewPointer(NewStruct("VMFunction", nullptr, true));
|
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.
|
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);
|
TypeStringStruct = NewStruct("Stringstruct", nullptr, true);
|
||||||
|
|
|
@ -372,6 +372,13 @@ FStartScreen* GetGameStartScreen(int max_progress)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FStartScreen::~FStartScreen()
|
||||||
|
{
|
||||||
|
if (StartupTexture) delete StartupTexture;
|
||||||
|
if (HeaderTexture) delete HeaderTexture;
|
||||||
|
if (NetTexture) delete NetTexture;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// ST_Util_ClearBlock
|
// ST_Util_ClearBlock
|
||||||
|
|
|
@ -70,7 +70,7 @@ protected:
|
||||||
FGameTexture* NetTexture = nullptr;
|
FGameTexture* NetTexture = nullptr;
|
||||||
public:
|
public:
|
||||||
FStartScreen(int maxp) { MaxPos = maxp; }
|
FStartScreen(int maxp) { MaxPos = maxp; }
|
||||||
virtual ~FStartScreen() = default;
|
virtual ~FStartScreen();
|
||||||
void Render(bool force = false);
|
void Render(bool force = false);
|
||||||
bool Progress(int);
|
bool Progress(int);
|
||||||
void NetProgress(int count);
|
void NetProgress(int count);
|
||||||
|
|
|
@ -21,6 +21,7 @@ void InitWidgetResources(const char* filename)
|
||||||
void CloseWidgetResources()
|
void CloseWidgetResources()
|
||||||
{
|
{
|
||||||
if (WidgetResources) delete WidgetResources;
|
if (WidgetResources) delete WidgetResources;
|
||||||
|
WidgetResources = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<uint8_t> LoadFile(const char* name)
|
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);
|
const FIWADInfo *D_FindIWAD(TArray<FString> &wadfiles, const char *iwad, const char *basewad);
|
||||||
void InitWidgetResources(const char* basewad);
|
void InitWidgetResources(const char* basewad);
|
||||||
|
void CloseWidgetResources();
|
||||||
|
|
||||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||||
|
|
||||||
|
@ -3844,6 +3845,7 @@ int GameMain()
|
||||||
M_SaveDefaultsFinal();
|
M_SaveDefaultsFinal();
|
||||||
DeleteStartupScreen();
|
DeleteStartupScreen();
|
||||||
C_UninitCVars(); // must come last so that nothing will access the CVARs anymore after deletion.
|
C_UninitCVars(); // must come last so that nothing will access the CVARs anymore after deletion.
|
||||||
|
CloseWidgetResources();
|
||||||
delete Args;
|
delete Args;
|
||||||
Args = nullptr;
|
Args = nullptr;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue