From kde-commits Mon Jan 18 21:11:18 2010 From: Andreas Hartmetz Date: Mon, 18 Jan 2010 21:11:18 +0000 To: kde-commits Subject: KDE/kdelibs/kio/kio Message-Id: <1263849078.329425.4632.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126384908815254 SVN commit 1076771 by ahartmetz: This hopefully fixes an assert failure when nothing is wrong; bug reported by teve on IRC. M +4 -5 scheduler.cpp --- trunk/KDE/kdelibs/kio/kio/scheduler.cpp #1076770:1076771 @@ -164,8 +164,6 @@ } - - int HostQueue::lowestSerial() const { QMap::ConstIterator first = m_queuedJobs.constBegin(); @@ -479,9 +477,10 @@ // we have dequeued the not yet running job with the lowest serial Q_ASSERT(!jobPriv->m_slave); Q_ASSERT(prevRunningJobs == hq.runningJobsCount()); - const bool removed = m_queuesBySerial.remove(prevLowestSerial); - Q_UNUSED(removed); - Q_ASSERT(removed); + if (m_queuesBySerial.remove(prevLowestSerial) == 0) { + // make sure that the queue was not scheduled for a good reason + Q_ASSERT(hq.runningJobsCount() == m_maxConnectionsPerHost); + } } else { if (prevRunningJobs != hq.runningJobsCount()) { // we have dequeued a previously running job