QNetworkAccessManager::post function returns network reply object, is caller required to delete this or network access manager will take care of deleting it.?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
you can do it in slot if readyRead
reply->abort();
reply->deleteLater();
reply->manager()->deleteLater();