122243 Resource leak

pull/1007/head
wise86Android 2016-09-24 15:55:37 +02:00
parent 04e0552f9e
commit 61097479c8
1 changed files with 5 additions and 2 deletions

View File

@ -488,7 +488,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
unsigned int iWidth, unsigned int iWidth,
unsigned int iHeight) unsigned int iHeight)
{ {
aiTexture* pcNew = NULL; aiTexture* pcNew = nullptr;
// get the type of the skin // get the type of the skin
unsigned int iMasked = (unsigned int)(iType & 0xF); unsigned int iMasked = (unsigned int)(iType & 0xF);
@ -522,7 +522,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
memcpy(pcNew->pcData,szCurrent,pcNew->mWidth); memcpy(pcNew->pcData,szCurrent,pcNew->mWidth);
szCurrent += iWidth; szCurrent += iWidth;
} }
if (0x7 == iMasked) else if (0x7 == iMasked)
{ {
// ***** REFERENCE TO EXTERNAL FILE ***** // ***** REFERENCE TO EXTERNAL FILE *****
if (1 != iHeight) if (1 != iHeight)
@ -546,6 +546,9 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
else if (iMasked || !iType || (iType && iWidth && iHeight)) else if (iMasked || !iType || (iType && iWidth && iHeight))
{ {
// ***** STANDARD COLOR TEXTURE ***** // ***** STANDARD COLOR TEXTURE *****
if(pcNew!= nullptr)
delete pcNew;
pcNew = new aiTexture(); pcNew = new aiTexture();
if (!iHeight || !iWidth) if (!iHeight || !iWidth)
{ {