[aKregator-devel] [Bug 99926] Akregator crashed after being open for a long time
Brought to you by:
lippel
From: Frank O. <fra...@kd...> - 2005-09-30 05:55:41
|
------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. http://bugs.kde.org/show_bug.cgi?id=99926 ------- Additional Comments From frank.osterfeld kdemail net 2005-09-30 07:55 ------- SVN commit 465538 by osterfeld: sanatize article expiry code, might be a bit slower, but less error-prone. users of 3.4 branch or upcoming 3.4.3, please give feedback if that fixes the problem. CCBUG: 99926 M +17 -17 feed.cpp --- branches/KDE/3.4/kdepim/akregator/src/feed.cpp #465537:465538 @ -530,33 +530,33 @ void Feed::slotDeleteExpiredArticles() { - bool changed = false; if ( !usesExpiryByAge() ) return; - ArticleSequence::ConstIterator it = m_articles.end(); + ArticleSequence::ConstIterator it = m_articles.begin(); ArticleSequence::ConstIterator tmp; - ArticleSequence::ConstIterator begin = m_articles.begin(); - // when we found an article which is not yet expired, we can stop, since articles are sorted by date - bool foundNotYetExpired = false; + ArticleSequence::ConstIterator end = m_articles.end(); - while ( !foundNotYetExpired && it != begin ) + ArticleSequence toBeDeleted; + + for ( ; it != end; ++it) { - --it; - if (!(*it).keep()) + if (!(*it).keep() && isExpired(*it) ) { - if ( isExpired(*it) ) - { - tmp = it; - m_articles.remove(*tmp); - changed = true; - } - else - foundNotYetExpired = true; + toBeDeleted.append(*it); } + } - if (changed) + + if (!toBeDeleted.isEmpty()) + { + end = toBeDeleted.end(); + for (it = toBeDeleted.begin(); it != end; ++it) + { + m_articles.remove(*it); + } modified(); + } } void Feed::setFavicon(const QPixmap &p) |