> Sent: Monday, January 29, 2018 at 10:44 PM
> From: "Tom Isaacson" <tom.isaac...@navico.com>
> To: "Interest@qt-project.org" <Interest@qt-project.org>
> Subject: [Interest] Lifetime of QNetworkReply from QNetworkAccessManager
>
> If I call a function like QNetworkAccessManager::head() with a 
> QNetworkRequest I get a pointer to a QNetworkReply. But who's responsible for 
> clearing up the QNetworkReply? Is it me, is it parented to the QNetworkReply, 
> is it parented to the QNetworkAccessManager? If the latter, if the 
> QNetworkAccessManager lasts for the lifetime of my application are all the 
> QNetworkReply's going to take memory for the lifetime of the app?
> 
> I'd expect this to be covered in the documentation but I can't see anything:
> https://doc.qt.io/qt-5/qnetworkaccessmanager.html#head
> 

It's in there:
"Note: After the request has finished, it is the responsibility of the user to 
delete the QNetworkReply object at an appropriate time. Do not directly delete 
it inside the slot connected to finished(). You can use the deleteLater() 
function."
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to