Fix possible crash on adding a magnet link

This commit is contained in:
Christophe Dumez
2011-01-12 16:55:10 +00:00
parent 4ac59dbaba
commit d5aaf975dd
3 changed files with 7 additions and 2 deletions

View File

@@ -1101,7 +1101,6 @@ void QBtSession::loadTorrentTempData(QTorrentHandle h, QString savePath, bool ma
if(TorrentTempData::hasTempData(hash)) {
// sequential download
h.set_sequential_download(TorrentTempData::isSequential(hash));
h.prioritize_first_last_piece(TorrentTempData::isSequential(hash));
// The following is useless for newly added magnet
if(!magnet) {
@@ -1110,6 +1109,9 @@ void QBtSession::loadTorrentTempData(QTorrentHandle h, QString savePath, bool ma
TorrentTempData::getFilesPriority(hash, fp);
h.prioritize_files(fp);
// Prioritize first/last piece
h.prioritize_first_last_piece(TorrentTempData::isSequential(hash));
// Update file names
const QStringList files_path = TorrentTempData::getFilesPath(hash);
bool force_recheck = false;