When qnetworkreply is delete after request from QNetworkAccessManager::get(QNetworkRequest request (url))?
Solved
General and Desktop
-
I am accessing the network using
QNetworkRequest
,QNetworkAccessManager
, andQNetworkReply
.At which place
m_reply
delete? it will delete whenmanager
delete or it will delete at any other place?QNetworkAccessManager* manager = new QNetworkAccessManager(); auto m_reply = manager ->get(QNetworkRequest request (https://www.google.com)); // Here read all the data from m_reply and call m_reply->close(); // again use same manage for request data m_reply = manager ->get(QNetworkRequest request (https://www.facebook.com));
Can I use
m_reply
variable in this way? -
Hi,
Usually you don't store the reply but rather connect its signals to lambdas, do the processing there and then call deleteLater on it once you are done.