Kaynağa Gözat

Use RL_FREE() instead of free()

pull/1262/head
raysan5 4 yıl önce
ebeveyn
işleme
b95673f701
2 değiştirilmiş dosya ile 10 ekleme ve 8 silme
  1. +1
    -1
      src/text.c
  2. +9
    -7
      src/textures.c

+ 1
- 1
src/text.c Dosyayı Görüntüle

@ -1797,7 +1797,7 @@ static Font LoadBMFont(const char *fileName)
}
UnloadImage(imFont);
free(fileText);
RL_FREE(fileText);
if (font.texture.id == 0)
{

+ 9
- 7
src/textures.c Dosyayı Görüntüle

@ -451,7 +451,8 @@ void ExportImageAsCode(Image image, const char *fileName)
bytesCount += sprintf(txtData + bytesCount, "0x%x };\n", ((unsigned char *)image.data)[dataSize - 1]);
SaveFileText(fileName, txtData);
free(txtData);
RL_FREE(txtData);
}
//------------------------------------------------------------------------------------
@ -3445,7 +3446,7 @@ static Image LoadDDS(const char *fileName)
}
}
free(fileData); // Free file data buffer
RL_FREE(fileData); // Free file data buffer
}
return image;
@ -3531,7 +3532,7 @@ static Image LoadPKM(const char *fileName)
else if (pkmHeader->format == 3) image.format = COMPRESSED_ETC2_EAC_RGBA;
}
free(fileData); // Free file data buffer
RL_FREE(fileData); // Free file data buffer
}
return image;
@ -3618,7 +3619,7 @@ static Image LoadKTX(const char *fileName)
else if (ktxHeader->glInternalFormat == 0x9278) image.format = COMPRESSED_ETC2_EAC_RGBA;
}
free(fileData); // Free file data buffer
RL_FREE(fileData); // Free file data buffer
}
return image;
@ -3717,7 +3718,8 @@ static int SaveKTX(Image image, const char *fileName)
}
SaveFileData(fileName, fileData, dataSize);
free(fileData); // Free file data buffer
RL_FREE(fileData); // Free file data buffer
// If all data has been written correctly to file, success = 1
return true;
@ -3857,7 +3859,7 @@ static Image LoadPVR(const char *fileName)
}
else if (pvrVersion == 52) TRACELOG(LOG_INFO, "IMAGE: [%s] PVRv2 format not supported, update your files to PVRv3", fileName);
free(fileData); // Free file data buffer
RL_FREE(fileData); // Free file data buffer
}
return image;
@ -3934,7 +3936,7 @@ static Image LoadASTC(const char *fileName)
else TRACELOG(LOG_WARNING, "IMAGE: [%s] ASTC block size configuration not supported", fileName);
}
free(fileData); // Free file data buffer
RL_FREE(fileData); // Free file data buffer
}
return image;

||||||
x
 
000:0
Yükleniyor…
İptal
Kaydet