From 258936362281ba64a101b005660337c86a5b60a7 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Thu, 1 Feb 2024 09:14:26 +0300 Subject: [PATCH] Don't use iterator after erase PR #20357. Closes #20356. --- src/base/bittorrent/sessionimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 730738dd2..4c4d87693 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -2449,7 +2449,7 @@ bool SessionImpl::cancelDownloadMetadata(const TorrentID &id) // if magnet link was hybrid initially then it is indexed also by v1 info hash // so we need to remove both entries const auto altID = TorrentID::fromSHA1Hash(infoHash.v1()); - m_downloadedMetadata.remove((altID == downloadedMetadataIter.key()) ? id : altID); + m_downloadedMetadata.remove(altID); } #endif