TFTDisplay destructor

This commit is contained in:
Ben Meadors
2025-09-05 06:22:21 -05:00
parent 68f07c5f9d
commit 3df3c876cc
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -1128,6 +1128,15 @@ TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY g
#endif
}
TFTDisplay::~TFTDisplay()
{
// Clean up allocated line pixel buffer to prevent memory leak
if (linePixelBuffer != nullptr) {
free(linePixelBuffer);
linePixelBuffer = nullptr;
}
}
// Write the buffer to the display memory
void TFTDisplay::display(bool fromBlank)
{