diff --git a/src/activities/reader/MdReaderActivity.cpp b/src/activities/reader/MdReaderActivity.cpp index 2cda2fbc..3b0a7f65 100644 --- a/src/activities/reader/MdReaderActivity.cpp +++ b/src/activities/reader/MdReaderActivity.cpp @@ -1001,6 +1001,8 @@ void MdReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION ac SETTINGS.orientation = nextOrientation; SETTINGS.saveToFile(); ReaderUtils::applyOrientation(renderer, SETTINGS.orientation); + initialized = false; + initializeReader(); requestUpdate(); break; } diff --git a/src/activities/reader/TxtReaderActivity.cpp b/src/activities/reader/TxtReaderActivity.cpp index d5840cfb..4ba4f35a 100644 --- a/src/activities/reader/TxtReaderActivity.cpp +++ b/src/activities/reader/TxtReaderActivity.cpp @@ -839,6 +839,8 @@ void TxtReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION a SETTINGS.orientation = nextOrientation; SETTINGS.saveToFile(); ReaderUtils::applyOrientation(renderer, SETTINGS.orientation); + initialized = false; + initializeReader(); requestUpdate(); break; } diff --git a/src/network/HttpDownloader.cpp b/src/network/HttpDownloader.cpp index 7f8aec68..d8b15a22 100644 --- a/src/network/HttpDownloader.cpp +++ b/src/network/HttpDownloader.cpp @@ -82,9 +82,7 @@ bool HttpDownloader::fetchUrl(const std::string& url, Stream& outContent, const if (httpCode != HTTP_CODE_OK) { LOG_ERR("HTTP", "Fetch failed: %d", httpCode); http.end(); - if (client) { - client->stop(); - } + client->stop(); return false; } @@ -142,9 +140,7 @@ HttpDownloader::DownloadError HttpDownloader::downloadToFile(const std::string& if (httpCode != HTTP_CODE_OK) { LOG_ERR("HTTP", "Download failed: %d", httpCode); http.end(); - if (client) { - client->stop(); - } + client->stop(); return HTTP_ERROR; } @@ -221,9 +217,7 @@ HttpDownloader::DownloadError HttpDownloader::downloadToFile(const std::string& file.flush(); file.close(); http.end(); - if (client) { - client->stop(); - } + client->stop(); if (writeResult < 0) { LOG_ERR("HTTP", "writeToStream error: %d", writeResult);