Fixed memory leak in countdown screen, causing a crash within 2 minutes
This commit is contained in:
parent
ad65d4e233
commit
617fa3fbd2
|
@ -119,7 +119,6 @@ const char* FormatPercentage(uint8_t percentage)
|
||||||
{
|
{
|
||||||
char* value = new char[6];
|
char* value = new char[6];
|
||||||
|
|
||||||
|
|
||||||
itoa(percentage, value, 10);
|
itoa(percentage, value, 10);
|
||||||
|
|
||||||
uint8_t length = strlen(value);
|
uint8_t length = strlen(value);
|
||||||
|
|
|
@ -14,7 +14,9 @@ inline uint32_t intDivCeil(uint32_t x, uint32_t y)
|
||||||
|
|
||||||
void CountdownScreen::printRemainingTime()
|
void CountdownScreen::printRemainingTime()
|
||||||
{
|
{
|
||||||
LCDPrintLineCentered(getDisplay(), 1, FormatTime(mLastDisplayed));
|
const char* time = FormatTime(mLastDisplayed);
|
||||||
|
LCDPrintLineCentered(getDisplay(), 1, time);
|
||||||
|
delete[] time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue