Solved Stop download with QNetworkReply
-
@mrjj yes I think
-
Hi! Does this also happen when you replace
abort()
withclose()
? Another thing: After callingabort()
, is thefinished()
signal emitted? -
And: On what platform do you observe this behaviour? Windows? Linux?
-
BTW: In your
cancelDownload()
function, it says:reply->abort(); reply = 0;
Looks like a memory leak to me.
-
@Wieland
i test before close()
i use Windows now -
hi
inDownloader::Downloader(QUrl Url, QObject *parent) : QObject(parent) { QNetworkRequest request(Url); DownloadManager.get(request);<<<<< THIS ? reply = DownloadManager.get(request);
you have extra DownloadManager.get(request);
if I // it, it now drops to 0 when I abort.
Before it did not. -
@mrjj Guter Mann. ;-)
-
@mrjj DownloadManager is a private member in downloader.h
-
@mrjj Yes thank you now I understand
i Fix it -
In my case, disconnecting all signals relating to QNetworkReply from all slots causes to abort() not works.
disconnect(m_reply, nullptr, nullptr, nullptr);
abort function works normal after commenting this line.