From 37625146625fc5770fde71052bd0a06db6742251 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Fri, 14 Feb 2020 08:24:49 +0300 Subject: [PATCH] Don't access download handler after it's finished --- src/base/rss/rss_feed.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/base/rss/rss_feed.cpp b/src/base/rss/rss_feed.cpp index 57a34b691..22ba644a7 100644 --- a/src/base/rss/rss_feed.cpp +++ b/src/base/rss/rss_feed.cpp @@ -124,7 +124,7 @@ void Feed::markAsRead() void Feed::refresh() { - if (isLoading()) + if (m_downloadHandler) m_downloadHandler->cancel(); // NOTE: Should we allow manually refreshing for disabled session? @@ -193,6 +193,8 @@ bool Feed::hasError() const void Feed::handleDownloadFinished(const Net::DownloadResult &result) { + m_downloadHandler = nullptr; // will be deleted by DownloadManager later + if (result.status == Net::DownloadStatus::Success) { LogMsg(tr("RSS feed at '%1' is successfully downloaded. Starting to parse it.") .arg(result.url));