File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2403,6 +2403,11 @@ bool SessionImpl::cancelDownloadMetadata(const TorrentID &id)
2403
2403
return false ;
2404
2404
2405
2405
const lt::torrent_handle nativeHandle = downloadedMetadataIter.value ();
2406
+ m_downloadedMetadata.erase (downloadedMetadataIter);
2407
+
2408
+ if (!nativeHandle.is_valid ())
2409
+ return true ;
2410
+
2406
2411
#ifdef QBT_USES_LIBTORRENT2
2407
2412
const InfoHash infoHash {nativeHandle.info_hashes ()};
2408
2413
if (infoHash.isHybrid ())
@@ -2413,7 +2418,7 @@ bool SessionImpl::cancelDownloadMetadata(const TorrentID &id)
2413
2418
m_downloadedMetadata.remove ((altID == downloadedMetadataIter.key ()) ? id : altID);
2414
2419
}
2415
2420
#endif
2416
- m_downloadedMetadata. erase (downloadedMetadataIter);
2421
+
2417
2422
m_nativeSession->remove_torrent (nativeHandle, lt::session::delete_files);
2418
2423
return true ;
2419
2424
}
You can’t perform that action at this time.
0 commit comments