- Fix crash when pausing a torrent if queueing system is disabled

This commit is contained in:
Christophe Dumez 2008-07-16 22:09:01 +00:00
parent 360c8500bb
commit 88ea548eaf

View file

@ -750,13 +750,15 @@ bool bittorrent::pauseTorrent(QString hash) {
// Remove it from TorrentsStartTime hash table
TorrentsStartTime.remove(hash);
TorrentsStartData.remove(hash);
// Remove it from queued list if present
if(queuedDownloads->contains(hash))
queuedDownloads->removeAll(hash);
if(queuedUploads->contains(hash))
queuedUploads->removeAll(hash);
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".queued"))
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".queued");
if(queueingEnabled) {
// Remove it from queued list if present
if(queuedDownloads->contains(hash))
queuedDownloads->removeAll(hash);
if(queuedUploads->contains(hash))
queuedUploads->removeAll(hash);
if(QFile::exists(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".queued"))
QFile::remove(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".queued");
}
return change;
}