[Qt-interest] QNetworkAccessManager warning
Tr3wory
tr3w at freemail.hu
Wed Jan 27 00:01:56 CET 2010
Do you mean reply->abort()?
The finished signal was emitted, so I don't think the abort is necessary.
(Anyway, I tested it, but it didn't help...)
tr3w
On Tue, Jan 26, 2010 at 11:38 PM, Scott Aron Bloom
<Scott.Bloom at sabgroup.com> wrote:
> There is a built in timeout to QNAM, which is probably implemented using a wait condition...
>
> I would call rquiest->abort() before closing
>
> Scott
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Tr3wory
> Sent: Tuesday, January 26, 2010 2:31 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QNetworkAccessManager warning
>
> It's empty.
>
> I found another interesting thing: if I wait more than 1 minute after
> the finished(QNetworkReply*) signal, then I don't get the message when
> the program is exiting.
>
> tr3w
>
> On Tue, Jan 26, 2010 at 11:14 PM, Iñigo Illán <kodeport at terra.es> wrote:
>> I think it could help if you also provide us the destructor of the class.
>>
>>
>> El mar, 26-01-2010 a las 22:28 +0100, Tr3wory escribió:
>>
>> Hi!
>>
>> Recently I switched my project from 4.5.2 to 4.6.1.
>> After that I always got a "QWaitCondition: Destroyed while threads are
>> still waiting" message when my program was exiting.
>>
>> I used QHttp to download a png from the net. If I removed it then the
>> message disappeared.
>>
>> Because the QHttp is obsolete I switched to QNetworAcessManager. But I
>> still get the message.
>>
>> Do you have any idea?
>>
>> Code:
>> QUrl url=tr("http://example.com/example.png");
>>
>> QNetworkAccessManager* netManager=new QNetworkAccessManager(this);
>>
>> connect(netManager,SIGNAL(finished(QNetworkReply*)),this,SLOT(onNetworkReplyFinished(QNetworkReply*)));
>> netManager->get(QNetworkRequest(url));
>> ...
>>
>> void MainWindow::onNetworkReplyFinished(QNetworkReply* reply)
>> {
>> if (reply->error()==QNetworkReply::NoError &&
>> m_banner.loadFromData(reply->readAll()) && m_mainMenu)
>> m_mainMenu->addBanner(m_banner);
>>
>> reply->deleteLater();
>> }
>>
>> Stack:
>> ...
>> 5 qWarning qglobal.cpp 2378 0x6a10e59d
>> 6 ~QWaitCondition qwaitcondition_win.cpp 155 0x6a115c90
>> 7 ~QThreadPoolPrivate qthreadpool_p.h 69 0x6a264afd
>> 8 QScopedPointerDeleter<QObjectData>::cleanup qscopedpointer.h 62 0x6a267f0a
>> 9 ~QScopedPointer qscopedpointer.h 100 0x6a25e9f1
>> 10 ~QObject qobject.cpp 992 0x6a20cbf8
>> 11 ~QThreadPool qthreadpool.cpp 430 0x6a10d72e
>> 12 ~QHostInfoLookupManager qhostinfo.cpp 454 0x6804ef50
>> 13 ~QGlobalStaticDeleter qglobal.h 1799 0x6809592f
>> 14 __tcf_0 qhostinfo.cpp 64 0x6804df5e
>> 15 __dll_exit C:\Qt\4.6.1\bin\QtNetworkd4.dll 0 0x6800102f
>> 16 DllMainCRTStartup at 12 C:\Qt\4.6.1\bin\QtNetworkd4.dll 0 0x680010f5
>> 17 ntdll!LdrSetAppCompatDllRedirectionC
>> allback C:\WINDOWS\system32\ntdll.dll 0 0x7c9011a7
>> 18 ?? 0 0x68000000
>> 19 ?? 0 0x00000000
>>
>> System:
>> Windows XP, MinGW 4.4, Qt 4.6.1
>>
>>
>> tr3w
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list