mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 14:04:23 +00:00
- A little downloadThread aborting improvement
This commit is contained in:
parent
cfcd9b7eaf
commit
668268b6b5
@ -81,7 +81,7 @@ void subDownloadThread::run(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
CURLcode res;
|
CURLcode res = (CURLcode)-1;
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
std::string c_url = url.toUtf8().data();
|
std::string c_url = url.toUtf8().data();
|
||||||
@ -123,10 +123,13 @@ void subDownloadThread::run(){
|
|||||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, -1);
|
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, -1);
|
||||||
qDebug("Downloading %s", url.toUtf8().data());
|
qDebug("Downloading %s", url.toUtf8().data());
|
||||||
res = curl_easy_perform(curl);
|
if(!abort)
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
/* always cleanup */
|
/* always cleanup */
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
if(abort)
|
||||||
|
return;
|
||||||
if(res) {
|
if(res) {
|
||||||
emit downloadFailureST(this, url, errorCodeToString(res));
|
emit downloadFailureST(this, url, errorCodeToString(res));
|
||||||
} else {
|
} else {
|
||||||
|
@ -668,7 +668,9 @@ class RssManager : public QObject{
|
|||||||
~RssManager(){
|
~RssManager(){
|
||||||
qDebug("Deleting RSSManager");
|
qDebug("Deleting RSSManager");
|
||||||
saveStreamList();
|
saveStreamList();
|
||||||
|
qDebug("Deleting all streams");
|
||||||
qDeleteAll(streams);
|
qDeleteAll(streams);
|
||||||
|
qDebug("Deleting downloader thread");
|
||||||
delete downloader;
|
delete downloader;
|
||||||
qDebug("RSSManager deleted");
|
qDebug("RSSManager deleted");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user