Handling during shuttdown

* Do not start new event loop when shutting down
* FSX Listener end checking when shutting down
* in same step fixed: FSX driver can connect to P3D and FSX but not vice versa
This commit is contained in:
Klaus Basan
2017-07-14 03:42:09 +02:00
committed by Mathew Sutcliffe
parent b3186d6b91
commit 380da41544
2 changed files with 17 additions and 12 deletions

View File

@@ -626,9 +626,9 @@ namespace BlackCore
bool CApplication::isNetworkAccessible() const
{
if (!this->m_accessManager) return false;
if (!this->m_accessManager) { return false; }
const QNetworkAccessManager::NetworkAccessibility a = this->m_accessManager->networkAccessible();
if (a == QNetworkAccessManager::Accessible) return true;
if (a == QNetworkAccessManager::Accessible) { return true; }
// currently I also accept unknown
return a == QNetworkAccessManager::UnknownAccessibility;
@@ -658,6 +658,7 @@ namespace BlackCore
{
instance()->gracefulShutdown();
}
// when the event loop is not running, this does nothing
QCoreApplication::exit(retcode);
}
@@ -669,6 +670,7 @@ namespace BlackCore
void CApplication::processEventsFor(int milliseconds)
{
if (CApplication::instance()->isShuttingDown()) { return; }
QEventLoop eventLoop;
QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit);
eventLoop.exec();