mirror of https://github.com/KDE/kasts.git
Solve memory leak when fetching feeds
This commit is contained in:
parent
710f44d2ef
commit
4f83ac8701
|
@ -39,8 +39,10 @@ void UpdateFeedJob::start()
|
||||||
|
|
||||||
void UpdateFeedJob::retrieveFeed()
|
void UpdateFeedJob::retrieveFeed()
|
||||||
{
|
{
|
||||||
if (m_abort)
|
if (m_abort) {
|
||||||
|
emitResult();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qCDebug(kastsFetcher) << "Starting to fetch" << m_url;
|
qCDebug(kastsFetcher) << "Starting to fetch" << m_url;
|
||||||
Q_EMIT feedUpdateStatusChanged(m_url, true);
|
Q_EMIT feedUpdateStatusChanged(m_url, true);
|
||||||
|
@ -58,8 +60,8 @@ void UpdateFeedJob::retrieveFeed()
|
||||||
setErrorText(m_reply->errorString());
|
setErrorText(m_reply->errorString());
|
||||||
} else {
|
} else {
|
||||||
QByteArray data = m_reply->readAll();
|
QByteArray data = m_reply->readAll();
|
||||||
Syndication::DocumentSource *document = new Syndication::DocumentSource(data, m_url);
|
Syndication::DocumentSource document(data, m_url);
|
||||||
Syndication::FeedPtr feed = Syndication::parserCollection()->parse(*document, QStringLiteral("Atom"));
|
Syndication::FeedPtr feed = Syndication::parserCollection()->parse(document, QStringLiteral("Atom"));
|
||||||
processFeed(feed);
|
processFeed(feed);
|
||||||
}
|
}
|
||||||
Q_EMIT feedUpdateStatusChanged(m_url, false);
|
Q_EMIT feedUpdateStatusChanged(m_url, false);
|
||||||
|
|
Loading…
Reference in New Issue