From 718a9ef73497880752dc187f3a768a3e6eb5d478 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Fri, 9 Apr 2021 22:52:20 +0200 Subject: [PATCH] Delete feed pointer as last action This to ensure that there will not be a dangling pointer when doing all the other delete operations (entries, enclosures, files and images). --- src/datamanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datamanager.cpp b/src/datamanager.cpp index d95782f9..4ff4a6db 100644 --- a/src/datamanager.cpp +++ b/src/datamanager.cpp @@ -199,9 +199,9 @@ void DataManager::removeFeed(const int &index) qDebug() << "Remove feed image" << feed->image() << "for feed" << feedurl; if (!feed->image().isEmpty()) Fetcher::instance().removeImage(feed->image()); - delete feed; // remove the pointer m_feeds.remove(m_feedmap[index]); // remove from m_feeds m_feedmap.removeAt(index); // remove from m_feedmap + delete feed; // remove the pointer // Then delete everything from the database qDebug() << "delete database part of" << feedurl;