Fix memory leak with Epub object getting orphaned

This commit is contained in:
Dave Allie
2025-12-06 02:49:10 +11:00
parent 7198d943b0
commit 98c8e7e77c
4 changed files with 22 additions and 10 deletions

View File

@@ -32,6 +32,7 @@ void FileSelectionScreen::loadFiles() {
void FileSelectionScreen::onEnter() {
basepath = "/";
loadFiles();
selectorIndex = 0;
// Trigger first update
updateRequired = true;
@@ -45,8 +46,11 @@ void FileSelectionScreen::onEnter() {
}
void FileSelectionScreen::onExit() {
vTaskDelete(displayTaskHandle);
displayTaskHandle = nullptr;
if (displayTaskHandle) {
vTaskDelete(displayTaskHandle);
displayTaskHandle = nullptr;
}
files.clear();
}
void FileSelectionScreen::handleInput(const Input input) {