Fixed a few very minor memory leaks. (by Asdow)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8882 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-08-13 02:33:39 +00:00
parent 2cdf1b2f0a
commit 7111f40e54
2 changed files with 44 additions and 0 deletions
@@ -6,6 +6,47 @@ PaletteTable::PaletteTable() {
}
PaletteTable::~PaletteTable() {
// FREE PALETTES
if (this->p8BPPPalette != NULL)
{
MemFree(this->p8BPPPalette);
this->p8BPPPalette = NULL;
}
if (this->p16BPPPalette != NULL)
{
MemFree(this->p16BPPPalette);
this->p16BPPPalette = NULL;
}
for (int cnt = 0; cnt < NUM_SOLDIER_SHADES; cnt++)
{
if (this->pShades[cnt] != NULL)
{
MemFree(this->pShades[cnt]);
this->pShades[cnt] = NULL;
}
}
for (int cnt = 0; cnt < NUM_SOLDIER_EFFECTSHADES; cnt++)
{
if (this->pEffectShades[cnt] != NULL)
{
MemFree(this->pEffectShades[cnt]);
this->pEffectShades[cnt] = NULL;
}
}
// Delete glows
for (int cnt = 0; cnt < 20; cnt++)
{
if (this->pGlowShades[cnt] != NULL)
{
MemFree(this->pGlowShades[cnt]);
this->pGlowShades[cnt] = NULL;
}
}
}
bool PaletteTable::CreateSGPPaletteFromActFile(SGPPaletteEntry *pPalette, std::string fileName) {