Commit d073a3d7 authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Don't create dangling iterators in TransferMultiSegKio

m_dataSourceFactory->mirrors() returns a value, which is destroyed after the
assignment, but the iterators still point to it.
parent 0b7bb22d
......@@ -182,8 +182,9 @@ void TransferMultiSegKio::slotDataSourceFactoryChange(Transfer::ChangesFlags cha
}
if (change & Tc_Source) {
m_source = QUrl();
QHash< QUrl, QPair<bool, int> >::const_iterator it = m_dataSourceFactory->mirrors().constBegin();
QHash< QUrl, QPair<bool, int> >::const_iterator end = m_dataSourceFactory->mirrors().constEnd();
QHash< QUrl, QPair<bool, int> > mirrors = m_dataSourceFactory->mirrors();
QHash< QUrl, QPair<bool, int> >::const_iterator it = mirrors.constBegin();
QHash< QUrl, QPair<bool, int> >::const_iterator end = mirrors.constEnd();
for (; it != end; it++) {
if (it.value().first) {
m_source = it.key();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment