QNetworkAccessManager导致警告:QWaitCondition:在线程仍在运行时被销毁

时间:2015-05-26 13:21:28

标签: c++ qt

void QGCCore::getLatestGCSVersion()
{
    QString url = "http://xxxxx";
    QNetworkRequest newRequest(url);
    newRequest.setUrl(url);

    QNetworkAccessManager *networkManager = new QNetworkAccessManager(this);
    connect(networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(downloadFinished(QNetworkReply*)));
    networkManager->get(newRequest);
}

void QGCCore::downloadFinished(QNetworkReply * reply)
{
    reply->deleteLater();
}

上面的代码,带有空构造函数和析构函数。 如果我启动软件并关闭它,它会发出警告:

QWaitCondition: destroyed while thread is still running.

但是,如果我等一会儿关闭它,那就好了...... 这里出了什么问题?

0 个答案:

没有答案