From 88ea548eaf6ddc21ce86a0b92613accf5ff544b4 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 16 Jul 2008 22:09:01 +0000 Subject: [PATCH] - Fix crash when pausing a torrent if queueing system is disabled --- src/bittorrent.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index fbfc7b965..787304e1b 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -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; }