diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 426a836..6cc7a89 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -386,15 +386,15 @@ void EpubReaderActivity::loop() { [this](QuickMenuAction action) { // Cache values before exitActivity EpubReaderActivity* self = this; - GfxRenderer& cachedRenderer = renderer; - MappedInputManager& cachedMappedInput = mappedInput; - const Section* cachedSection = section.get(); SemaphoreHandle_t cachedMutex = renderingMutex; exitActivity(); if (action == QuickMenuAction::DICTIONARY) { - // Open dictionary menu + // Open dictionary menu - cache renderer/input for this scope + GfxRenderer& cachedRenderer = self->renderer; + MappedInputManager& cachedMappedInput = self->mappedInput; + const Section* cachedSection = self->section.get(); self->enterNewActivity(new DictionaryMenuActivity( cachedRenderer, cachedMappedInput, [self](DictionaryMode mode) {