Fix deleteSprite

Fixes #736 and also delete color map even if the sprite has not been created.
This commit is contained in:
Bodmer
2020-08-28 21:18:26 +01:00
parent 1c66d306d5
commit 731228d13a
4 changed files with 11 additions and 11 deletions

View File

@@ -125,7 +125,7 @@ void* TFT_eSprite::getPointer(void)
/***************************************************************************************
** Function name: created
** Description: Returns true is sprite has been created
** Description: Returns true if sprite has been created
***************************************************************************************/
bool TFT_eSprite::created(void)
{
@@ -376,18 +376,18 @@ uint16_t TFT_eSprite::getPaletteColor(uint8_t index)
***************************************************************************************/
void TFT_eSprite::deleteSprite(void)
{
if (!_created ) return;
if (_colorMap != nullptr)
{
free(_colorMap);
_colorMap = nullptr;
}
if (_created)
{
free(_img8_1);
_img8 = nullptr;
_created = false;
}
}

View File

@@ -16,7 +16,7 @@
#ifndef _TFT_eSPIH_
#define _TFT_eSPIH_
#define TFT_ESPI_VERSION "2.2.18"
#define TFT_ESPI_VERSION "2.2.19"
/***************************************************************************************
** Section 1: Load required header files

View File

@@ -1,6 +1,6 @@
{
"name": "TFT_eSPI",
"version": "2.2.18",
"version": "2.2.19",
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
"repository":

View File

@@ -1,5 +1,5 @@
name=TFT_eSPI
version=2.2.18
version=2.2.19
author=Bodmer
maintainer=Bodmer
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32