Don't use iterator after erase

PR #20357.
Closes #20356.
This commit is contained in:
Vladimir Golovnev (Glassez) 2024-02-01 09:14:26 +03:00
parent cfa7a6db46
commit 2589363622
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7

View file

@ -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