From f90aba898074dbd1edc07112b63b8816bbc5855c Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 24 Jul 2009 10:42:15 +0200 Subject: QNAM: Clarify docs about when a QNetworkReply can be deleted Task-number: 258644 Reviewed-by: Thiago --- src/network/access/qnetworkaccessmanager.cpp | 9 +++++++-- src/network/access/qnetworkreply.cpp | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 748d893787..8eb2c1bf45 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -121,7 +121,9 @@ static void ensureInitialized() as well as meta-data (headers, etc.). \note After the request has finished, it is the responsibility of the user - to delete the QNetworkReply object at an appropriate time. + 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. A more involved example, assuming the manager is already existent, can be: @@ -199,6 +201,9 @@ static void ensureInitialized() See QNetworkReply::finished() for information on the status that the object will be in. + \note Do not delete the \a reply object in the slot connected to this + signal. Use deleteLater(). + \sa QNetworkReply::finished(), QNetworkReply::error() */ @@ -573,7 +578,7 @@ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request) The returned QNetworkReply object will be open for reading and will contain the reply sent by the server to the POST request. - Note: sending a POST request on protocols other than HTTP and + \note sending a POST request on protocols other than HTTP and HTTPS is undefined and will probably fail. \sa get(), put() diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index c655918ca8..a7a77cb84a 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -87,6 +87,9 @@ QNetworkReplyPrivate::QNetworkReplyPrivate() indicates the progress of the upload for operations that have such content. + \note Do not delete the object in the slot connected to the + error() or finished() signal. Use deleteLater(). + \sa QNetworkRequest, QNetworkAccessManager */ @@ -228,6 +231,9 @@ QNetworkReplyPrivate::QNetworkReplyPrivate() QNetworkAccessManager::finished() where that signal's reply parameter is this object. + \note Do not delete the object in the slot connected to this + signal. Use deleteLater(). + \sa QNetworkAccessManager::finished() */ @@ -242,6 +248,9 @@ QNetworkReplyPrivate::QNetworkReplyPrivate() detected. Call errorString() to obtain a textual representation of the error condition. + \note Do not delete the object in the slot connected to this + signal. Use deleteLater(). + \sa error(), errorString() */ -- cgit v1.2.3