[Qt-interest] Aborting QNetworkReply::post() causes crash

Markus Goetz Markus.Goetz at nokia.com
Fri Nov 6 11:34:43 CET 2009


Hi,

ext Info wrote:
> I've come across an issue when aborting a POST operation which seems 
> to cause a crash every time:
>
> QNetworkReply *reply = m_Manager.post(request, data); // m_Manager is 
> a QNetworkAccessManager
>
> Now, in the same event loop, I call:
>
> reply->abort();
>
> And in the finished(QNetworkReply*) slot I have a single call:
>
> reply->deleteLater();
>
> Every time this leads to a crash, the offending line is in 
> qhttpnetworkreply_p.h, line 146. The 'this' pointer is 0x00000000, so 
> it seems the deleteLater() call is deleting the QNetworkReply before 
> the final bytesWritten() slot is triggered.
>
> What would cause this to happen? Should I be calling deleteLater() in 
> the finished() slot? The documentation suggests it and states that 
> there will be no more updates to the reply's data or metadata but it 
> seems it is still trying to read from the post input device after the 
> finished() event.
Which Qt version?
Do you have a full backtrace?

Thanks,
Markus




More information about the Qt-interest-old mailing list