Fixed memory leak when using createPalette from FLASH
This commit is contained in:
parent
8c83eb84bd
commit
f64a24e0ef
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue