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.
但是,如果我等一会儿关闭它,那就好了...... 这里出了什么问题?