diff options
-rw-r--r-- | examples/network/torrent/ratecontroller.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/network/torrent/ratecontroller.cpp b/examples/network/torrent/ratecontroller.cpp index 756947b65c..18d0737dbb 100644 --- a/examples/network/torrent/ratecontroller.cpp +++ b/examples/network/torrent/ratecontroller.cpp @@ -129,7 +129,7 @@ void RateController::transfer() auto current = it++; PeerWireClient *socket = *current; if (socket->state() != QAbstractSocket::ConnectedState) { - pendingSockets.erase(current); + it = pendingSockets.erase(current); continue; } @@ -158,7 +158,7 @@ void RateController::transfer() if (dataTransferred && socket->canTransferMore()) canTransferMore = true; else - pendingSockets.erase(current); + it = pendingSockets.erase(current); } } while (canTransferMore && (bytesToWrite > 0 || bytesToRead > 0) && !pendingSockets.isEmpty()); |