diff --git a/src/main.cpp b/src/main.cpp index 2fa20bed..6b227065 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -215,9 +215,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() {