diff --git a/platform/qt/src/http_file_source.cpp b/platform/qt/src/http_file_source.cpp index 90abdd0aa..f4fb0749a 100644 --- a/platform/qt/src/http_file_source.cpp +++ b/platform/qt/src/http_file_source.cpp @@ -75,8 +75,12 @@ void HTTPFileSource::Impl::onReplyFinished() QByteArray data = reply->readAll(); QVector& requestsVector = it.value().second; - for (auto req : requestsVector) { - req->handleNetworkReply(reply, data); + + // Cannot use the iterator to walk the requestsVector + // because calling handleNetworkReply() might get + // requests added to the requestsVector. + while (!requestsVector.isEmpty()) { + requestsVector.takeFirst()->handleNetworkReply(reply, data); } m_pending.erase(it);