[Qt-interest] Aborting QNetworkReply::post() causes crash
Info
info at misafe.com
Fri Nov 6 17:14:14 CET 2009
Hi Markus,
I've just been testing with the 4.6-stable release and the problem is
fixed. Thanks for your help!
On 6 Nov 2009, at 10:34, Markus Goetz wrote:
> 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