QNetworkAccessManager在获取

时间:2016-02-03 19:00:42

标签: c++ qt crash qnetworkaccessmanager qnetworkreply

QNetworkAccessManager工作得很好,然后每次都在get()方法上开始崩溃,这很简单:

QNetworkReply *reply = myManager->get(QNetworkRequest(QUrl(myUrl)));

Stack如下:


    0   RtlpAllocateHeap    ntdll       0x77a93364  
    1   RtlAllocateHeap ntdll       0x77a93074  
    2   RtlDebugAllocateHeap    ntdll       0x77b310d3  
    3   RtlpAllocateHeap    ntdll       0x77aeb16e  
    4   RtlAllocateHeap ntdll       0x77a93074  
    5   _heap_alloc_base    MSVCR100D       0x53be8343  
    6   _nh_malloc_dbg  MSVCR100D       0x53bf697c  
    7   _nh_malloc_dbg  MSVCR100D       0x53bf671f  
    8   _nh_malloc_dbg  MSVCR100D       0x53bf66cc  
    9   malloc  MSVCR100D       0x53bf9c5b  
    10  operator new    MSVCR100D       0x53be7db1  
    11  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53cecbff  
    12  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53efa480  
    13  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53dbc736  
    14  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53db97d1  
    15  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53db9d26  
    16  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53e0ea8b  
    17  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53e2417c  
    18  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53db8d02  
    19  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53db9f4d  
    20  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53e2c690  
    21  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53e2d020  
    22  QByteArrayMatcher::~QByteArrayMatcher   QtCored4        0x53e2c13b  
    23  QNetworkProxy::setPassword  QtNetworkd4     0x536593e3  
    24  QNetworkProxy::setPassword  QtNetworkd4     0x53658a58  
    25  QNetworkProxy::setPassword  QtNetworkd4     0x53656eb4  
    26  QNetworkProxy::setPassword  QtNetworkd4     0x5365359e  
    27  QNetworkProxy::setPassword  QtNetworkd4     0x536534b8  
    28  QNetworkProxy::setPassword  QtNetworkd4     0x536537ea  
    29  QNetworkProxy::setPassword  QtNetworkd4     0x5360c06f  
    30  QNetworkProxy::setPassword  QtNetworkd4     0x5360b2ec  
    31  get command here    myfile.cpp  73  0x552b9123  
    32  main    main.cpp    409 0x13aca9    
    33  WinMain qtmain_win.cpp  131 0xa0e55a    
    34  __tmainCRTStartup   crtexe.c    547 0xa0d7d0    
    35  WinMainCRTStartup   crtexe.c    371 0xa0d55f    
    36  BaseThreadInitThunk kernel32        0x75f9336a  
    37  __RtlUserThreadStart    ntdll       0x77a992b2  
    38  _RtlUserThreadStart ntdll       0x77a99285  

P.S。现在有时会开始崩溃:

QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();

其他团队成员运行此代码时,其他PC和地方都没有问题。原因是什么?!网络问题,防病毒,防火墙(试图切断两者没有运气)等?!为什么它调用QNetworkProxy :: setPassword ?!我没有代理,试图明确设置NoProxy没有运气。问题可能是什么?有什么想法吗?

1 个答案:

答案 0 :(得分:-2)

重启Qt和创建者并重启帮助。