Fix a few remaining leaks in idFont, SWF Scripts, and idTrigger_Touch

This commit is contained in:
Stephen Saunders 2023-11-21 11:12:01 -05:00 committed by Robert Beckebans
parent cb209718be
commit 04c638fb28
6 changed files with 24 additions and 4 deletions

View file

@ -1290,6 +1290,17 @@ idTrigger_Touch::idTrigger_Touch()
clipModel = NULL;
}
/*
================
idTrigger_Touch::~idTrigger_Touch
================
*/
idTrigger_Touch::~idTrigger_Touch()
{
// SRS - Delete clipModel on cleanup, otherwise will leak
delete clipModel;
}
/*
================
idTrigger_Touch::Spawn

View file

@ -272,6 +272,7 @@ private:
class idTrigger_Touch : public idTrigger
{
public:
~idTrigger_Touch();
CLASS_PROTOTYPE( idTrigger_Touch );

View file

@ -86,6 +86,14 @@ idFont::~idFont
*/
idFont::~idFont()
{
// SRS - Free glyph data before deleting fontInfo, otherwise will leak
if( fontInfo )
{
Mem_Free( fontInfo->glyphData );
fontInfo->glyphData = NULL;
Mem_Free( fontInfo->charIndex );
fontInfo->charIndex = NULL;
}
delete fontInfo;
}

View file

@ -112,7 +112,7 @@ public:
}
}
private:
int refCount;
std::atomic<int> refCount;
};
/*
@ -281,7 +281,7 @@ private:
// RB end
private:
int refCount;
std::atomic<int> refCount;
uint16 flags;
const byte* data;

View file

@ -184,7 +184,7 @@ public:
void PrintToConsole() const;
private:
int refCount;
std::atomic<int> refCount;
bool noAutoDelete;
enum swfNamedVarFlags_t

View file

@ -58,7 +58,7 @@ public:
}
private:
int refCount;
std::atomic<int> refCount;
};
/*