diff --git a/src/main.cpp b/src/main.cpp index 6e145d10..59f75a1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -216,9 +216,9 @@ void onGoHome(); void onGoToMyLibraryWithPath(const std::string& path); void onGoToRecentBooks(); void onGoToReader(const std::string& initialEpubPath) { + const std::string bookPath = initialEpubPath; // Copy before exitActivity() invalidates the reference exitActivity(); - enterNewActivity( - new ReaderActivity(renderer, mappedInputManager, initialEpubPath, onGoHome, onGoToMyLibraryWithPath)); + enterNewActivity(new ReaderActivity(renderer, mappedInputManager, bookPath, onGoHome, onGoToMyLibraryWithPath)); } void onGoToFileTransfer() {