This commit is contained in:
Alexey Sharov 2023-02-02 23:27:48 +01:00 committed by GitHub
commit 6f17dc68ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -254,6 +254,11 @@ void TFT_eSprite::createPalette(uint16_t colorMap[], uint8_t colors)
***************************************************************************************/ ***************************************************************************************/
void TFT_eSprite::createPalette(const uint16_t colorMap[], uint8_t colors) void TFT_eSprite::createPalette(const uint16_t colorMap[], uint8_t colors)
{ {
if (_colorMap != nullptr)
{
free(_colorMap);
}
if (colorMap == nullptr) if (colorMap == nullptr)
{ {
// Create a color map using the default FLASH map // Create a color map using the default FLASH map