Qt – Deleting ‘QNetworkReply *’ returned by QNetworkAccessManager::post

qtqt4

QNetworkAccessManager::post function returns network reply object, is caller required to delete this or network access manager will take care of deleting it.?

Best Answer

From the documentation:

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.

Related Topic