Qt应用程序堆栈溢出异常

时间:2017-08-04 14:00:34

标签: qt qnetworkreply

我想调用QNetworkReply::readAll,如Foo()所示,这样一旦完成,就应该再次调用它。

    QString Foo (QString& requestUrl)
    {
       QNetworkReply *pReply = NetManager::getManager()->get(requestUrl,NULL,NULL);
       QEventLoop loop;
       QObject::connect(pReply,SIGNAL(finished()),&loop,SLOT(quit()));
       loop.exec();
       return pReply->readAll();
   }

我想要这个,因为我的Qt Gui应用程序与0xC00000FD: Stack overflow exception崩溃了。在callstack中,我反复调用函数,如下面的callstack所示。

我不明白,尽管使用QEventLoop来调用readAll()同步,但如何进行递归。

用户可以使用我的Gui应用程序点击并启动readAll()

有没有办法防止崩溃?

MyUtility.dll!Class::Function(l) Line abc   C++
Qt5Core.dll!0000000052b0991c()  Unknown
Qt5Widgets.dll!0000000056ff9d9a()   Unknown
Qt5Widgets.dll!0000000056ffb4ff()   Unknown
Qt5Widgets.dll!00000000570e8c57()   Unknown
Qt5Core.dll!0000000052aeb905()  Unknown
Qt5Widgets.dll!0000000056fd4ff2()   Unknown
Qt5Widgets.dll!0000000056fd35a6()   Unknown
Qt5Core.dll!0000000052ae9aea()  Unknown
Qt5Widgets.dll!0000000057021e95()   Unknown
Qt5Widgets.dll!00000000570204ee()   Unknown
Qt5Widgets.dll!0000000056fd5006()   Unknown
Qt5Widgets.dll!0000000056fd4623()   Unknown
Qt5Core.dll!0000000052ae9aea()  Unknown
Qt5Gui.dll!000007fededd3c52()   Unknown
Qt5Gui.dll!000007fededd5f67()   Unknown
Qt5Gui.dll!000007fededc379e()   Unknown
Qt5Core.dll!0000000052b2e6c5()  Unknown
user32.dll!UserCallWinProcCheckWow()    Unknown
user32.dll!DispatchMessageWorker()  Unknown
Qt5Core.dll!0000000052b2ddfc()  Unknown
qwindows.dll!000007fedd1df491() Unknown
Qt5Core.dll!0000000052ae6c61()  Unknown
MyUtility.dll!Class::Function(l) Line abc   C++
Qt5Core.dll!0000000052b0991c()  Unknown
Qt5Widgets.dll!0000000056ff9d9a()   Unknown
Qt5Widgets.dll!0000000056ffb4ff()   Unknown
Qt5Widgets.dll!00000000570e8c57()   Unknown
Qt5Core.dll!0000000052aeb905()  Unknown
Qt5Widgets.dll!0000000056fd4ff2()   Unknown
Qt5Widgets.dll!0000000056fd35a6()   Unknown
Qt5Core.dll!0000000052ae9aea()  Unknown
Qt5Widgets.dll!0000000057021e95()   Unknown
Qt5Widgets.dll!00000000570204ee()   Unknown
Qt5Widgets.dll!0000000056fd5006()   Unknown
Qt5Widgets.dll!0000000056fd4623()   Unknown
Qt5Core.dll!0000000052ae9aea()  Unknown
Qt5Gui.dll!000007fededd3c52()   Unknown
Qt5Gui.dll!000007fededd5f67()   Unknown
Qt5Gui.dll!000007fededc379e()   Unknown
Qt5Core.dll!0000000052b2e6c5()  Unknown
user32.dll!UserCallWinProcCheckWow()    Unknown
user32.dll!DispatchMessageWorker()  Unknown
Qt5Core.dll!0000000052b2ddfc()  Unknown
qwindows.dll!000007fedd1df491() Unknown
Qt5Core.dll!0000000052ae6c61()  Unknown
Qt5Core.dll!0000000052ae8d39()  Unknown
MyUtility.exe!main(int argc, char * * argv) Line abc    C++
MyUtility.exe!WinMain() C++

0 个答案:

没有答案